Fix typo in alternate mts.conf location support.
[mmh] / test / whatnow / test-ls
1 #!/bin/sh
2 ######################################################
3 #
4 # Test that whatnow's "ls" copes with directory names
5 # which have spaces and quotes in them (see bug #23319)
6 #
7 ######################################################
8
9 if [ -z "${MH_TEST_COMMON}" ]; then
10     echo "MH_TEST_COMMON not set; try running via 'make check'"
11 fi
12
13 . ${MH_TEST_COMMON}
14
15 setup_test
16
17 set -e
18 SPDIR="$MH_TEST_DIR/foo's bar"
19 rm -rf "$SPDIR"
20 mkdir "$SPDIR"
21 cd "$SPDIR"
22 touch baz boz
23
24 expectederr=$MH_TEST_DIR/$$.expectederr
25 actualerr=$MH_TEST_DIR/$$.actualerr
26 expected=$MH_TEST_DIR/$$.expected
27 actual=$MH_TEST_DIR/$$.actual
28
29 cat > $expected <<EOF
30 baz
31 boz
32 EOF
33
34 cat > $expectederr <<EOF
35 EOF
36
37 # NB use of sort as the order of output of ls is not guaranteed
38 echo 'ls' | whatnow -noedit -prompt '' 2> "$actualerr" | sort > "$actual"
39
40 diff -u $expectederr $actualerr || exit 1
41 diff -u $expected $actual