Rework in the test framework; updated and new tests
[mmh] / test / tests / folder / x-test-packf
1 #!/bin/sh
2 ######################################################
3 #
4 # Test packf
5 #
6 ######################################################
7
8 . "$MH_TEST_COMMON"
9
10
11 runandcheck "packf -help" <<!
12 Usage: packf [+folder] [msgs] [switches]
13   switches are:
14   -Version
15   -help
16 !
17
18 #runandcheck "packf -nonexistent" <<!
19 #packf: -nonexistent unknown
20 #!
21
22 cd "$MH_TEST_DIR"  ||  exit 1
23
24 # check with no switches
25 runandcheck "packf >msgbox" <<!
26 !
27
28 folder -create +inbox2 >/dev/null
29 inc +inbox2 -file msgbox >/dev/null
30 rm -f msgbox
31
32 for i in `pick +inbox`; do
33         diff -u "`mhpath +inbox $i`" "`mhpath +inbox2 $i`"
34 done
35
36 runandcheck 'echo $i' <<!
37 10
38 !
39
40
41 rmm -unlink +inbox2 a
42
43
44 # check +folder
45 runandcheck "packf +inbox >msgbox" <<!
46 !
47 inc +inbox2 -file msgbox >/dev/null
48 rm -f msgbox
49 for i in `pick +inbox`; do
50         diff -u "`mhpath +inbox "$i"`" "`mhpath +inbox2 "$i"`"
51 done
52 runandcheck "echo $i" <<!
53 10
54 !
55 rmm -unlink +inbox2 a
56
57 # check msgs
58 runandcheck "packf +inbox 1 2 3 >msgbox" <<!
59 !
60
61 inc +inbox2 -file msgbox >/dev/null
62 rm -f msgbox
63 for i in `pick +inbox2`; do
64         diff -u "`mhpath +inbox "$i"`" "`mhpath +inbox2 "$i"`"
65 done
66 runandcheck "echo $i" <<!
67 3
68 !
69 rmm -unlink +inbox2 a
70