mirror of
https://github.com/bpkg/bpkg
synced 2024-11-17 21:26:01 +00:00
36 lines
510 B
Bash
Executable File
36 lines
510 B
Bash
Executable File
#! /usr/bin/env bash
|
|
|
|
cd ${0%/*}
|
|
|
|
. ../JSON.sh
|
|
|
|
ptest () {
|
|
tokenize | parse >/dev/null
|
|
}
|
|
|
|
fails=0
|
|
i=0
|
|
echo "1..4"
|
|
for input in '"oooo" ' '[true, 1, [0, {}]] ' '{"true": 1}'
|
|
do
|
|
i=$((i+1))
|
|
if echo "$input" | ptest
|
|
then
|
|
echo "ok $i - $input"
|
|
else
|
|
echo "not ok $i - $input"
|
|
fails=$((fails+1))
|
|
fi
|
|
done
|
|
|
|
if ! ptest < ../package.json
|
|
then
|
|
echo "not ok 4 - Parsing package.json failed!"
|
|
fails=$((fails+1))
|
|
else
|
|
echo "ok $i - package.json"
|
|
fi
|
|
|
|
echo "$fails test(s) failed"
|
|
exit $fails
|