--- test/testrunner.sh.orig 2021-01-06 15:44:11.000000000 -0800 +++ test/testrunner.sh 2021-01-06 15:50:28.000000000 -0800 @@ -54,18 +54,18 @@ declare -i expectedReturnCode=0 if [ $(grep -c "^:EXPECTED-ERROR " $testCaseFile) -eq 1 ]; then - expectedReturnCode=$(grep "^:EXPECTED-ERROR " $testCaseFile | sed -e 's/:EXPECTED-ERROR //') + expectedReturnCode=$(grep "^:EXPECTED-ERROR " $testCaseFile | gsed -e 's/:EXPECTED-ERROR //') fi declare -r testInputFile=${testCaseFile/%.txt/.input.tmp} declare -r testExpectationFile=${testCaseFile/%.txt/.expected.tmp} -declare -r testFilterFile=${testCaseFile/%.txt/.sed.tmp} +declare -r testFilterFile=${testCaseFile/%.txt/.gsed.tmp} declare -r testOutputFile=${testCaseFile/%.txt/.out.tmp} -declare -r boxesArgs=$(cat $testCaseFile | sed -n '/^:ARGS/,+1p' | grep -v ^:INPUT | sed '1d') +declare -r boxesArgs=$(cat $testCaseFile | gsed -n '/^:ARGS/,+1p' | grep -v ^:INPUT | gsed '1d') -cat $testCaseFile | sed -n '/^:INPUT/,/^:OUTPUT-FILTER/p;' | sed '1d;$d' | tr -d '\r' > $testInputFile -cat $testCaseFile | sed -n '/^:OUTPUT-FILTER/,/^:EXPECTED\b.*$/p;' | sed '1d;$d' | tr -d '\r' > $testFilterFile -cat $testCaseFile | sed -n '/^:EXPECTED/,/^:EOF/p;' | sed '1d;$d' | tr -d '\r' > $testExpectationFile +cat $testCaseFile | gsed -n '/^:INPUT/,/^:OUTPUT-FILTER/p;' | gsed '1d;$d' | tr -d '\r' > $testInputFile +cat $testCaseFile | gsed -n '/^:OUTPUT-FILTER/,/^:EXPECTED\b.*$/p;' | gsed '1d;$d' | tr -d '\r' > $testFilterFile +cat $testCaseFile | gsed -n '/^:EXPECTED/,/^:EOF/p;' | gsed '1d;$d' | tr -d '\r' > $testExpectationFile declare boxesBinary=../src/boxes.exe if [ ! -x $boxesBinary ]; then @@ -77,7 +77,7 @@ cat $testInputFile | $boxesBinary $boxesArgs >$testOutputFile 2>&1 declare -ir actualReturnCode=$? -cat $testOutputFile | tr -d '\r' | sed -f $testFilterFile | diff - $testExpectationFile +cat $testOutputFile | tr -d '\r' | gsed -f $testFilterFile | diff - $testExpectationFile if [ $? -ne 0 ]; then >&2 echo "Error in test case: $testCaseFile (top: actual; bottom: expected)" exit 5