depricate whatnow
[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 cat > $expectederr <<EOF
31 whatnow: whatnow is deprecated. Consider switching to whatnow2.
32 whatnow: whatnow is deprecated. Consider switching to whatnow2.
33 whatnow: whatnow is deprecated. Consider switching to whatnow2.
34 whatnow: whatnow is deprecated. Consider switching to whatnow2.
35 EOF
36
37 # whatnow's exit status is always 1 so that is not a failure
38 set +e
39 echo "attach baz\\'s\\ boz" | whatnow -editor true -prompt '' 2>> $actualerr >> $actual
40 echo "alist" | whatnow -editor true -prompt '' 2>> $actualerr >> $actual
41 echo "detach 1" | whatnow -editor true -prompt '' 2>> $actualerr >> $actual
42 echo "alist" | whatnow -editor true -prompt '' 2>> $actualerr >> $actual
43 set -e
44
45 diff -u $expectederr $actualerr
46 <$actual sed 's,/.*/,/XXX/,' >$actual.clean
47 diff -u $expected $actual.clean