82b25c695276884043b0364a3361f900ae65cc3a
[mmh] / test / tests / whatnow / test-attach-detach
1 #!/bin/sh
2 ######################################################
3 #
4 # Test that whatnow's "ls" copes with directory names
5 # which have spaces in them (see bug #23319)
6 #
7 ######################################################
8
9 set -e
10
11 cd "$MH_TEST_DIR"
12 rm -f "baz's boz"
13 touch "baz's boz"
14 # whatnow's attach stuff needs a draft to work on
15 # cp "$MH_TEST_DIR/Mail/inbox/1" "$MH_TEST_DIR/Mail/draft"
16 comp +inbox 1 -whatnow true
17
18 expectederr=$MH_TEST_DIR/$$.expectederr
19 actualerr=$MH_TEST_DIR/$$.actualerr
20 expected=$MH_TEST_DIR/$$.expected
21 actual=$MH_TEST_DIR/$$.actual
22
23 rm -f $expected $expectederr $actual $actualerr
24 touch $expected $expectederr $actual $actualerr
25
26 cat > $expected <<EOF
27 1       /XXX/baz's boz
28 EOF
29
30 # whatnow's exit status is always 1 so that is not a failure
31 set +e
32 echo "attach baz\\'s\\ boz" | whatnow -editor true -prompt '' 2>> $actualerr >> $actual
33 echo "alist" | whatnow -editor true -prompt '' 2>> $actualerr >> $actual
34 echo "detach 1" | whatnow -editor true -prompt '' 2>> $actualerr >> $actual
35 echo "alist" | whatnow -editor true -prompt '' 2>> $actualerr >> $actual
36 set -e
37
38 diff -u $expectederr $actualerr
39 <$actual sed 's,/.*/,/XXX/,' >$actual.clean
40 diff -u $expected $actual.clean