You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
bpkg/lib/json/test/valid-test.sh

22 lines
377 B
Bash

#! /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