2
0
mirror of https://github.com/bpkg/bpkg synced 2024-11-17 21:26:01 +00:00
bpkg/lib/json/test/valid-test.sh
Joseph Werle 16a53e5bcb init
2014-05-22 15:52:58 -04:00

22 lines
377 B
Bash
Executable File

#! /usr/bin/env bash
cd ${0%/*}
fails=0
i=0
tests=`ls valid/*.json -1l | 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