From 4503f2de631e237f5b79fb22c6742eae5732c0e0 Mon Sep 17 00:00:00 2001 From: Nigel Tao Date: Fri, 21 Feb 2020 21:33:46 +1100 Subject: [PATCH] Add test/data/json-things.*.json --- build-all.sh | 15 +++++++++++---- test/data/json-things.formatted.json | 12 ++++++++++++ test/data/json-things.unformatted.json | 1 + 3 files changed, 24 insertions(+), 4 deletions(-) create mode 100644 test/data/json-things.formatted.json create mode 100644 test/data/json-things.unformatted.json diff --git a/build-all.sh b/build-all.sh index 2106bc35..e035a516 100755 --- a/build-all.sh +++ b/build-all.sh @@ -70,14 +70,21 @@ wuffs test -skipgen -mimic wuffs bench -skipgen -mimic -reps=1 -iterscale=1 ./build-example.sh -LICENSE_CRC32=$(gen/bin/example-crc32 < LICENSE) -if [ "$LICENSE_CRC32" != "1ea3b7b0" ]; then - echo "LICENSE crc32 mismatch" +echo "Running gen/bin/example-crc32" +JSON_THINGS_CRC32=$(gen/bin/example-crc32 < test/data/json-things.formatted.json) +if [ "$JSON_THINGS_CRC32" != "cdcc7e35" ]; then + echo "example-crc32 failed on json-things data" + exit 1 +fi +echo "Running gen/bin/example-jsonptr" +JSON_THINGS_CRC32=$(gen/bin/example-jsonptr < test/data/json-things.unformatted.json | gen/bin/example-crc32) +if [ "$JSON_THINGS_CRC32" != "cdcc7e35" ]; then + echo "example-jsonptr failed on json-things data" exit 1 fi ./build-fuzz.sh for f in gen/bin/fuzz-*; do - echo "Running $f" + echo "Running $f" $f test/data > /dev/null done diff --git a/test/data/json-things.formatted.json b/test/data/json-things.formatted.json new file mode 100644 index 00000000..511dd2f9 --- /dev/null +++ b/test/data/json-things.formatted.json @@ -0,0 +1,12 @@ +{ + "k0": [ + 42, + [ + false, + true + ] + ], + "k1": 234.56e+7, + "k二": null, + "k³": "\t\\\n\n" +} diff --git a/test/data/json-things.unformatted.json b/test/data/json-things.unformatted.json new file mode 100644 index 00000000..e5aba150 --- /dev/null +++ b/test/data/json-things.unformatted.json @@ -0,0 +1 @@ +{"k0":[42,[false,true]],"k1": 234.56e+7 ,"\u006b\u4E8C":null, "k³": "\t\\\n\u000a"} \ No newline at end of file