X-Git-Url: http://git.marmaro.de/?a=blobdiff_plain;f=test%2Fwhatnow%2Ftest-cd;h=1ff5d96251760eb8560a5f88487d4b075b86af62;hb=ab719ef6625da100f92aa8c2d6f8ae6ea7bae2cb;hp=d92f334fca0b6167171ccb31426a13623d676c80;hpb=6106441685a38400d9aa94ccb7218218102f941c;p=mmh diff --git a/test/whatnow/test-cd b/test/whatnow/test-cd index d92f334..1ff5d96 100755 --- a/test/whatnow/test-cd +++ b/test/whatnow/test-cd @@ -6,21 +6,21 @@ # ###################################################### -if [ -z "${MH_TEST_COMMON}" ]; then - echo "MH_TEST_COMMON not set; try running via 'make check'" +set -e + +if test -z "${MH_OBJ_DIR}"; then + srcdir=`dirname "$0"`/../.. + MH_OBJ_DIR=`cd "$srcdir" && pwd`; export MH_OBJ_DIR fi -. ${MH_TEST_COMMON} +. "$MH_OBJ_DIR/test/common.sh" 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 @@ -36,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