json: rearrange schema test to allow for modified output
Schemas can insert default values, so we need to be able to test the resultant files.
This commit is contained in:
parent
30c35b2101
commit
94640d00f0
1
test/json/schema/empty/good/0001.result.json
Normal file
1
test/json/schema/empty/good/0001.result.json
Normal file
@ -0,0 +1 @@
|
|||||||
|
[1,"a", {}]
|
1
test/json/schema/signed_min/good/0001.result.json
Normal file
1
test/json/schema/signed_min/good/0001.result.json
Normal file
@ -0,0 +1 @@
|
|||||||
|
0
|
1
test/json/schema/string_length/good/0001.result.json
Normal file
1
test/json/schema/string_length/good/0001.result.json
Normal file
@ -0,0 +1 @@
|
|||||||
|
"ab"
|
1
test/json/schema/string_length/good/0002.result.json
Normal file
1
test/json/schema/string_length/good/0002.result.json
Normal file
@ -0,0 +1 @@
|
|||||||
|
"abcdef"
|
25
test/json/schema/test.sh
Executable file
25
test/json/schema/test.sh
Executable file
@ -0,0 +1,25 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
tool="/home/danny/src/lobo/build/debug/gcc/cruft/util/json-schema"
|
||||||
|
src="/home/danny/src/lobo/cruft/util/test/json/schema"
|
||||||
|
|
||||||
|
for base in $(ls "${src}"); do
|
||||||
|
[ -d ${base} ] || continue
|
||||||
|
|
||||||
|
echo "testing ${base}"
|
||||||
|
|
||||||
|
schema="${base}/schema.json"
|
||||||
|
|
||||||
|
for good in $(ls "${base}/good/"*.input.json); do
|
||||||
|
[ -f "${good}" ] || continue
|
||||||
|
|
||||||
|
expected="${good%.input.json}.result.json"
|
||||||
|
echo "${tool} ${schema} ${good} ${expected}"
|
||||||
|
done
|
||||||
|
|
||||||
|
for bad in $(ls "${base}/bad/"*.json); do
|
||||||
|
[ -f "${bad}" ] || continue
|
||||||
|
|
||||||
|
echo "${tool} ${schema} ${bad}"
|
||||||
|
done
|
||||||
|
done
|
1
test/json/schema/type_any/good/0005.result.json
Normal file
1
test/json/schema/type_any/good/0005.result.json
Normal file
@ -0,0 +1 @@
|
|||||||
|
true
|
1
test/json/schema/type_any/good/0006.result.json
Normal file
1
test/json/schema/type_any/good/0006.result.json
Normal file
@ -0,0 +1 @@
|
|||||||
|
null
|
1
test/json/schema/type_integer/bad/0003-string.json
Normal file
1
test/json/schema/type_integer/bad/0003-string.json
Normal file
@ -0,0 +1 @@
|
|||||||
|
"foo"
|
1
test/json/schema/type_number/bad/0001.json
Normal file
1
test/json/schema/type_number/bad/0001.json
Normal file
@ -0,0 +1 @@
|
|||||||
|
"foo"
|
1
test/json/schema/type_number/good/0001.input.json
Normal file
1
test/json/schema/type_number/good/0001.input.json
Normal file
@ -0,0 +1 @@
|
|||||||
|
3.14
|
1
test/json/schema/type_number/good/0001.result.json
Normal file
1
test/json/schema/type_number/good/0001.result.json
Normal file
@ -0,0 +1 @@
|
|||||||
|
3.14
|
1
test/json/schema/type_number/good/0002.result.json
Normal file
1
test/json/schema/type_number/good/0002.result.json
Normal file
@ -0,0 +1 @@
|
|||||||
|
3
|
1
test/json/schema/type_object/bad/0001.json
Normal file
1
test/json/schema/type_object/bad/0001.json
Normal file
@ -0,0 +1 @@
|
|||||||
|
[]
|
1
test/json/schema/type_object/good/0001.result.json
Normal file
1
test/json/schema/type_object/good/0001.result.json
Normal file
@ -0,0 +1 @@
|
|||||||
|
{}
|
1
test/json/schema/unsigned_max/good/0001.result.json
Normal file
1
test/json/schema/unsigned_max/good/0001.result.json
Normal file
@ -0,0 +1 @@
|
|||||||
|
-1
|
Loading…
Reference in New Issue
Block a user