2 ######################################################
4 # Test that whatnow's "ls" copes with directory names
5 # which have spaces in them (see bug #23319)
7 ######################################################
11 if test -z "${MH_OBJ_DIR}"; then
12 srcdir=`dirname "$0"`/../..
13 MH_OBJ_DIR=`cd "$srcdir" && pwd`; export MH_OBJ_DIR
16 . "$MH_OBJ_DIR/test/common.sh"
22 testname_quoted="baz\'s\ boz"
24 # whatnow's attach stuff needs a draft to work on
25 cp "$MH_TEST_DIR/Mail/inbox/1" "$MH_TEST_DIR/Mail/draft"
27 expectederr=$MH_TEST_DIR/$$.expectederr
28 actualerr=$MH_TEST_DIR/$$.actualerr
29 expected=$MH_TEST_DIR/$$.expected
30 actual=$MH_TEST_DIR/$$.actual
32 rm -f $expected $expectederr $actual $actualerr
33 touch $expected $expectederr $actual $actualerr
36 # Sigh. Different readline versions change echoing behavior, so we need
41 whatnowtest=`echo cd | TERM=dumb whatnow -prompt ''`
44 case ${whatnowtest} in
45 cd) cat > "$expected" <<EOF
46 attach $testname_quoted
49 detach $testname_quoted
53 "") cat > "$expected" <<EOF
57 *) echo "Unknown response to whatnow readline test"
58 echo "Response is: ${whatnowtest}"
63 # whatnow's exit status is always 1 so that is not a failure
65 echo "attach $testname_quoted" | \
66 TERM=dumb whatnow -attach foo -noedit -prompt '' 2>> $actualerr >> $actual
67 echo "alist" | TERM=dumb whatnow -attach foo -noedit -prompt '' \
68 2>> $actualerr >> $actual
69 echo "detach $testname_quoted" | \
70 TERM=dumb whatnow -attach foo -noedit -prompt '' 2>> $actualerr >> $actual
71 echo "alist" | TERM=dumb whatnow -attach foo -noedit -prompt '' \
72 2>> $actualerr >> $actual
75 check "$expectederr" "$actualerr"
76 check "$expected" "$actual"
78 test ${failed:-0} -eq 0 && rm "$testname"