tests: lint for run-away here-doc
[gitweb.git] / t / test-lib.sh
index 86d77c16dd3abcedd3fd4937a73b142a6b83b7b6..d5f2b70bce53227a47a73ec8e78abaeb9e3c6436 100644 (file)
@@ -624,9 +624,9 @@ test_run_ () {
                trace=
                # 117 is magic because it is unlikely to match the exit
                # code of other programs
-               test_eval_ "(exit 117) && $1"
-               if test "$?" != 117; then
-                       error "bug in the test script: broken &&-chain: $1"
+               if test "OK-117" != "$(test_eval_ "(exit 117) && $1${LF}${LF}echo OK-\$?" 3>&1)"
+               then
+                       error "bug in the test script: broken &&-chain or run-away HERE-DOC: $1"
                fi
                trace=$trace_tmp
        fi