2 ######################################################
4 # Test that whatnow's "ls" copes with directory names
5 # which have spaces and quotes 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 SPDIR="$MH_TEST_DIR/foo's bar"
26 expectederr=$MH_TEST_DIR/$$.expectederr
27 actualerr=$MH_TEST_DIR/$$.actualerr
28 expected=$MH_TEST_DIR/$$.expected
29 actual=$MH_TEST_DIR/$$.actual
32 # Handle different output depending on readline version
36 whatnowtest="$(echo cd | TERM=dumb whatnow -prompt '')"
39 case "${whatnowtest}" in
40 cd) cat > "$expected" <<EOF
46 "") cat > "$expected" <<EOF
51 *) echo "Unknown response to whatnow readline test"
52 echo "Response is: ${whatnowtest}"
57 cat > $expectederr <<EOF
60 # NB use of sort as the order of output of ls is not guaranteed
61 echo 'ls' | TERM=dumb whatnow -noedit -prompt '' 2> "$actualerr" | \
64 check "$expectederr" "$actualerr"
65 check "$expected" "$actual"
67 # On some platforms, need to be out of $SPDIR in order to remove it.
69 test ${failed:-0} -eq 0 && rm -r "$SPDIR"