X-Git-Url: https://diplodocus.org/git/nmh/blobdiff_plain/e107aac243dbd4021e57f4c455c7e3ffd82b819e..dfa7b4ffa462d4f24016ab4729928dee5ec389bb:/test/whatnow/test-cd diff --git a/test/whatnow/test-cd b/test/whatnow/test-cd index d8feb341..1ff5d962 100755 --- a/test/whatnow/test-cd +++ b/test/whatnow/test-cd @@ -6,6 +6,8 @@ # ###################################################### +set -e + if test -z "${MH_OBJ_DIR}"; then srcdir=`dirname "$0"`/../.. MH_OBJ_DIR=`cd "$srcdir" && pwd`; export MH_OBJ_DIR @@ -15,13 +17,10 @@ fi setup_test -set -e SPDIR="$MH_TEST_DIR/foo's bar" rm -rf "$SPDIR" mkdir "$SPDIR" -cd "$SPDIR" -touch baz boz -cd +(cd "$SPDIR" && touch baz boz) expectederr=$MH_TEST_DIR/$$.expectederr actualerr=$MH_TEST_DIR/$$.actualerr @@ -37,7 +36,12 @@ EOF # ||true to ignore whatnow's exit status # watch the quoting -- shell and printf and then the shell run inside whatnow -printf "cd $MH_TEST_DIR/foo\\\\'s\\\\ bar\npwd\n" | whatnow -noedit -prompt '' 2> "$actualerr" > "$actual" || true +printf "cd $MH_TEST_DIR/foo\\\\'s\\\\ bar\npwd\n" | \ + whatnow -noedit -prompt '' 2> "$actualerr" > "$actual" || true + +check "$expectederr" "$actualerr" +check "$expected" "$actual" + +test ${failed:-0} -eq 0 && rm -r "$SPDIR" -diff -u $expectederr $actualerr || exit 1 -diff -u $expected $actual +exit $failed