-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.sh
executable file
·49 lines (43 loc) · 933 Bytes
/
test.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#!/usr/bin/env bash
# SPDX-FileCopyrightText: 2018 Tuomas Siipola
# SPDX-License-Identifier: CC0-1.0
./jpp < test-input.json > test-output.json
diff test-expected.json test-output.json &> /dev/null
if [ $? -eq 0 ]; then
echo "OK test-input.json"
else
echo "FAIL test-input.json"
fi
for f in jsonchecker/pass*; do
./jpp < $f &> /dev/null
if [ $? -eq 0 ]; then
echo "OK $f"
else
echo "FAIL $f"
fi
done
# Skip fail1.json because top-level value can be anything, not just object or array
for f in jsonchecker/fail{2..33}.json; do
./jpp < $f &> /dev/null
if [ $? -eq 0 ]; then
echo "FAIL $f"
else
echo "OK $f"
fi
done
for f in jsontestsuite/y_*; do
./jpp < $f &> /dev/null
if [ $? -eq 0 ]; then
echo "OK $f"
else
echo "FAIL $f"
fi
done
for f in jsontestsuite/n_*; do
./jpp < $f &> /dev/null
if [ $? -eq 0 ]; then
echo "FAIL $f"
else
echo "OK $f"
fi
done