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"
20 # Set TERM to get consistent output.
21 TERM=dumb; export TERM
25 testname_quoted="baz\'s\ boz"
27 # whatnow's attach stuff needs a draft to work on
28 cp "$MH_TEST_DIR/Mail/inbox/1" "$MH_TEST_DIR/Mail/draft"
30 expectederr=$MH_TEST_DIR/$$.expectederr
31 actualerr=$MH_TEST_DIR/$$.actualerr
32 expected=$MH_TEST_DIR/$$.expected
33 actual=$MH_TEST_DIR/$$.actual
35 rm -f $expected $expectederr $actual $actualerr
36 touch $expected $expectederr $actual $actualerr
39 # Sigh. Different readline versions change echoing behavior, so we need
44 whatnowtest=`echo cd | whatnow -prompt ''`
47 case ${whatnowtest} in
48 cd) cat > "$expected" <<EOF
49 attach $testname_quoted
52 detach $testname_quoted
56 "") cat > "$expected" <<EOF
60 *) echo "Unknown response to whatnow readline test"
61 echo "Response is: ${whatnowtest}"
66 # whatnow's exit status is always 1 so that is not a failure
68 echo "attach $testname_quoted" | \
69 run_prog whatnow -attach foo -noedit -prompt '' 2>> $actualerr >> $actual
71 run_prog whatnow -attach foo -noedit -prompt '' 2>> $actualerr >> $actual
72 echo "detach $testname_quoted" | \
73 run_prog whatnow -attach foo -noedit -prompt '' 2>> $actualerr >> $actual
75 run_prog whatnow -attach foo -noedit -prompt '' 2>> $actualerr >> $actual
78 check "$expectederr" "$actualerr"
79 check "$expected" "$actual"
81 test ${failed:-0} -eq 0 && rm "$testname"