]> diplodocus.org Git - nmh/blobdiff - test/inc/test-pop
Test to make sure mhshow is actually invoking a charset conversion
[nmh] / test / inc / test-pop
index 580f0cdaaed314d2e0fb6b3058cdf9ea9b8a7410..2bb0bb4d40a3493c8d7e8ae054b7199320472b55 100755 (executable)
@@ -56,8 +56,52 @@ run_test "inc -user ${TESTUSER} -host 127.0.0.1 -port $testport -width 80" \
        "Incorporating new mail into inbox...
 
   11+ 12/17 No Such User       Hello<<Hey man, how's it going? . Hope you're do"
+check $testmessage `mhpath +inbox 11` 'keep first'
 
-check `mhpath +inbox 11` $testmessage
-rm -f $testmessage "$netrc"
+# check -pack
+pid=`"${MH_OBJ_DIR}/test/fakepop" "$testmessage" "$testport" \
+                       "$TESTUSER" "$TESTPASS"`
+
+touch "$MH_TEST_DIR/inc.mbox"
+run_test "inc -user ${TESTUSER} -host 127.0.0.1 -port $testport -width 80 \
+          -pack $MH_TEST_DIR/inc.mbox" \
+       "Incorporating new mail into (null)...
+
+   1  12/17 No Such User       Hello<<Hey man, how's it going? . Hope you're do"
+run_test "inc -file $MH_TEST_DIR/inc.mbox -truncate" \
+       "Incorporating new mail into inbox...
+
+  11+ 12/17 No Such User       Hello<<Hey man, how's it going? . Hope you're do"
+
+check $testmessage `mhpath +inbox 11` 'keep first'
+rm -f "$MH_TEST_DIR/inc.mbox" "$MH_TEST_DIR/.inc.map" "$netrc"
+
+# check credentials: file
+# Redirect stdin so that inc doesn't wait on the user if it can't
+# read the netrc file, even though that shouldn't happen.
+TESTUSER=differenuser
+TESTPASS=differentpass
+
+netrc="${HOME}/.mhnetrc"
+echo "default login ${TESTUSER} password ${TESTPASS}" > "$netrc"
+chmod 600 "$netrc"
+echo "credentials: file:${netrc}" >>$MH
+
+pid=`"${MH_OBJ_DIR}/test/fakepop" "$testmessage" "$testport" \
+                       "$TESTUSER" "$TESTPASS"`
+
+touch "$MH_TEST_DIR/inc.mbox"
+run_test "inc -user ${TESTUSER} -host 127.0.0.1 -port $testport -width 65 \
+          -pack $MH_TEST_DIR/inc.mbox" \
+       "Incorporating new mail into (null)...
+
+   1  12/17 No Such User       Hello<<Hey man, how's it going? ." </dev/null
+run_test "inc -file $MH_TEST_DIR/inc.mbox -truncate -width 65" \
+       "Incorporating new mail into inbox...
+
+  11+ 12/17 No Such User       Hello<<Hey man, how's it going? ." </dev/null
+
+check $testmessage `mhpath +inbox 11`
+rm -f "$MH_TEST_DIR/inc.mbox" "$MH_TEST_DIR/.inc.map" "$netrc"
 
 exit ${failed:-0}