libcruft-util/test/json.test
Danny Robson 228421d974 test: run all checks through the TAP driver
This will allow more natural checking of hashes and json as they expand.
2014-05-23 17:11:28 +10:00

28 lines
489 B
Bash
Executable File

#!/bin/sh
validate=../tools/json-validate
good=(json/good/*)
bad=(json/bad/*)
count=$((${#good[@]}+${#bad[@]}))
echo 1..$count
for i in ${good[@]};
do
$validate $i 2>/dev/null 1>&2
case $? in
0) echo "ok - $(basename $i .json)";;
*) echo "not ok - $(basename $i .json)";;
esac
done
for i in ${bad[@]};
do
$validate $i 1>&2 2>/dev/null
case $? in
0) echo "not ok - $(basename $i .json)";;
*) echo "ok - $(basename $i .json)";;
esac
done