toml/test2/run.sh

35 lines
609 B
Bash
Raw Normal View History

2019-10-10 08:11:52 +00:00
if ! (which jq >& /dev/null); then
echo "ERROR: please install the 'jq' utility"
exit 1
fi
2019-10-08 23:58:18 +00:00
#
# POSITIVE tests
#
for i in toml-spec-tests/values/*.toml; do
echo -n $i ' '
2019-10-10 08:11:52 +00:00
res='[OK]'
if (../toml_json $i >& $i.json.out); then
jq . $i.json.out > t.json
2019-10-10 08:28:09 +00:00
mv t.json $i.json.out
if [ -f $i.json ] && (diff $i.json $i.json.out >& /dev/null); then
2019-10-10 08:11:52 +00:00
res='[FAILED]'
fi
2019-10-08 23:58:18 +00:00
fi
2019-10-10 08:11:52 +00:00
echo $res
2019-10-08 23:58:18 +00:00
done
#
# NEGATIVE tests
#
for i in toml-spec-tests/errors/*.toml; do
echo -n $i ' '
2019-10-10 08:11:52 +00:00
if (../toml_json $i >& $i.json.out); then
2019-10-08 23:58:18 +00:00
echo '[FAILED]'
2019-10-10 08:11:52 +00:00
else
echo '[OK]'
2019-10-08 23:58:18 +00:00
fi
done