#!/bin/sh cd $(0%/*) setglobal tmp = $(TEMP:-/tmp) setglobal tmp = "$(tmp%%/)/" # Avoid duplicate // setglobal fails = '0' setglobal i = '0' setglobal tests = $[ls valid/*.json | wc -l] echo "1..$tests" for input in [valid/*.json] { setglobal input_file = $(input##*/) setglobal expected = ""$(tmp)$(input_file%.json).no-head"" egrep -v '^\[]' < $(input%.json).parsed > $expected setglobal i = $shExpr('i+1') if ! ../JSON.sh -n < $input | diff -u - $expected { echo "not ok $i - $input" setglobal fails = $shExpr('fails+1') } else { echo "ok $i - $input" } } echo "$fails test(s) failed" exit $fails # vi: expandtab sw=2 ts=2