Permalink
Find file
Fetching contributors…
Cannot retrieve contributors at this time
executable file 22 lines (20 sloc) 368 Bytes
#!/bin/sh
cd ${0%/*}
fails=0
i=0
tests=`ls valid/*.json | wc -l`
echo "1..${tests##* }"
for input in valid/*.json
do
expected="${input%.json}.parsed"
i=$((i+1))
if ! ../JSON.sh < "$input" | diff -u - "$expected"
then
echo "not ok $i - $input"
fails=$((fails+1))
else
echo "ok $i - $input"
fi
done
echo "$fails test(s) failed"
exit $fails