Rework in the test framework; updated and new tests
[mmh] / test / tests / folder / x-test-packf
diff --git a/test/tests/folder/x-test-packf b/test/tests/folder/x-test-packf
new file mode 100755 (executable)
index 0000000..ca3d393
--- /dev/null
@@ -0,0 +1,70 @@
+#!/bin/sh
+######################################################
+#
+# Test packf
+#
+######################################################
+
+. "$MH_TEST_COMMON"
+
+
+runandcheck "packf -help" <<!
+Usage: packf [+folder] [msgs] [switches]
+  switches are:
+  -Version
+  -help
+!
+
+#runandcheck "packf -nonexistent" <<!
+#packf: -nonexistent unknown
+#!
+
+cd "$MH_TEST_DIR"  ||  exit 1
+
+# check with no switches
+runandcheck "packf >msgbox" <<!
+!
+
+folder -create +inbox2 >/dev/null
+inc +inbox2 -file msgbox >/dev/null
+rm -f msgbox
+
+for i in `pick +inbox`; do
+       diff -u "`mhpath +inbox $i`" "`mhpath +inbox2 $i`"
+done
+
+runandcheck 'echo $i' <<!
+10
+!
+
+
+rmm -unlink +inbox2 a
+
+
+# check +folder
+runandcheck "packf +inbox >msgbox" <<!
+!
+inc +inbox2 -file msgbox >/dev/null
+rm -f msgbox
+for i in `pick +inbox`; do
+       diff -u "`mhpath +inbox "$i"`" "`mhpath +inbox2 "$i"`"
+done
+runandcheck "echo $i" <<!
+10
+!
+rmm -unlink +inbox2 a
+
+# check msgs
+runandcheck "packf +inbox 1 2 3 >msgbox" <<!
+!
+
+inc +inbox2 -file msgbox >/dev/null
+rm -f msgbox
+for i in `pick +inbox2`; do
+       diff -u "`mhpath +inbox "$i"`" "`mhpath +inbox2 "$i"`"
+done
+runandcheck "echo $i" <<!
+3
+!
+rmm -unlink +inbox2 a
+