Rework in the test framework; updated and new tests
[mmh] / test / tests / rcv / test-rcvpack
diff --git a/test/tests/rcv/test-rcvpack b/test/tests/rcv/test-rcvpack
new file mode 100755 (executable)
index 0000000..357eb01
--- /dev/null
@@ -0,0 +1,52 @@
+#!/bin/sh
+######################################################
+#
+# Test rcvpack
+#
+######################################################
+
+
+. "$MH_TEST_COMMON"
+
+
+
+# check -help
+runandcheck "rcvpack -help" <<!
+Usage: rcvpack [switches] file
+  switches are:
+  -Version
+  -help
+!
+
+# check -Version
+case `rcvpack -V` in
+  rcvpack\ --*) ;;
+  *           ) printf '%s: rcvpack -v generated unexpected output\n' "$0" >&2
+                failed=`expr ${failed:-0} + 1`;;
+esac
+
+# check unknown switch
+runandcheck "rcvpack -nonexistent" <<!
+rcvpack: -nonexistent unknown
+!
+
+# check with no switches
+runandcheck "rcvpack </dev/null" <<!
+
+!
+
+
+# check mbox creation
+runandcheck "rcvpack <$MH_TEST_DIR/Mail/inbox/1 $MH_TEST_DIR/Mail/mbox" <<!
+!
+inc -file $MH_TEST_DIR/Mail/mbox -silent
+diff -u "$MH_TEST_DIR/Mail/inbox/1" "$MH_TEST_DIR/Mail/inbox/11"
+
+
+# check append to existing mbox file
+runandcheck "rcvpack <$MH_TEST_DIR/Mail/inbox/2 $MH_TEST_DIR/Mail/mbox" <<!
+!
+inc -file $MH_TEST_DIR/Mail/mbox -silent
+diff -u "$MH_TEST_DIR/Mail/inbox/1" "$MH_TEST_DIR/Mail/inbox/12"
+diff -u "$MH_TEST_DIR/Mail/inbox/2" "$MH_TEST_DIR/Mail/inbox/13"
+