From ecc350ca5c2eb50be8309c5f14f8bf0d87db9a02 Mon Sep 17 00:00:00 2001 From: Moon Flower Date: Mon, 12 Oct 2026 08:46:23 +0330 Subject: a --- docs/history/13-gap-fixes/code/tests/runerr.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100755 docs/history/13-gap-fixes/code/tests/runerr.sh (limited to 'docs/history/13-gap-fixes/code/tests/runerr.sh') diff --git a/docs/history/13-gap-fixes/code/tests/runerr.sh b/docs/history/13-gap-fixes/code/tests/runerr.sh new file mode 100755 index 0000000..23ea054 --- /dev/null +++ b/docs/history/13-gap-fixes/code/tests/runerr.sh @@ -0,0 +1,10 @@ +#!/bin/bash +# runs every .zc in a folder (tests/errors by default) and checks the compiler +# rejects it with the message on its first line: // expect: ... +vm=${1:-zy}; dir=${2:-$(dirname "$0")/errors}; pass=0; fail=0 +for f in "$dir"/*.zc; do + want=$(head -1 "$f" | sed 's#^// expect: ##') + got=$($vm < "$f" 2>&1 | head -1) + if [[ "$got" == *"$want"* ]]; then pass=$((pass+1)); else fail=$((fail+1)); echo "FAIL $(basename $f): got [$got]"; fi +done +echo "rejected: $pass passed, $fail failed" -- cgit v1.2.3