diff options
author | Petri Lehtinen <petri@digip.org> | 2009-12-16 22:05:55 +0200 |
---|---|---|
committer | Petri Lehtinen <petri@digip.org> | 2009-12-21 12:50:49 +0200 |
commit | 3889af476ba52e98de210e8e0b3b4a44a26b3a60 (patch) | |
tree | c2f2e6187a50edbfe325e85e2f70981af185bff3 /test/suites/encoding-flags | |
parent | 19a606d7361e73ff2f5e0b240c2adb07b35e4273 (diff) | |
download | jansson-3889af476ba52e98de210e8e0b3b4a44a26b3a60.zip jansson-3889af476ba52e98de210e8e0b3b4a44a26b3a60.tar.gz jansson-3889af476ba52e98de210e8e0b3b4a44a26b3a60.tar.bz2 |
Enhance tests
* Now that JSON_SORT_KEYS is implemented, take it into use with the
valid and valid-strip suites. This is to ensure that the tests
remain valid even if the string hash function is changed in the
future.
* Remove test_dump API test. Instead, implement the same tests more
elegantly in the encoding-flags suite.
Diffstat (limited to 'test/suites/encoding-flags')
25 files changed, 46 insertions, 0 deletions
diff --git a/test/suites/encoding-flags/array/input b/test/suites/encoding-flags/array/input new file mode 100644 index 0000000..44e2ace --- /dev/null +++ b/test/suites/encoding-flags/array/input @@ -0,0 +1 @@ +[1, 2] diff --git a/test/suites/encoding-flags/array/output b/test/suites/encoding-flags/array/output new file mode 100644 index 0000000..fd8ef09 --- /dev/null +++ b/test/suites/encoding-flags/array/output @@ -0,0 +1 @@ +[1, 2]
\ No newline at end of file diff --git a/test/suites/encoding-flags/compact-array/env b/test/suites/encoding-flags/compact-array/env new file mode 100644 index 0000000..9eab19d --- /dev/null +++ b/test/suites/encoding-flags/compact-array/env @@ -0,0 +1 @@ +export JSON_COMPACT=1 diff --git a/test/suites/encoding-flags/compact-array/input b/test/suites/encoding-flags/compact-array/input new file mode 100644 index 0000000..44e2ace --- /dev/null +++ b/test/suites/encoding-flags/compact-array/input @@ -0,0 +1 @@ +[1, 2] diff --git a/test/suites/encoding-flags/compact-array/output b/test/suites/encoding-flags/compact-array/output new file mode 100644 index 0000000..3169929 --- /dev/null +++ b/test/suites/encoding-flags/compact-array/output @@ -0,0 +1 @@ +[1,2]
\ No newline at end of file diff --git a/test/suites/encoding-flags/compact-object/env b/test/suites/encoding-flags/compact-object/env new file mode 100644 index 0000000..9eab19d --- /dev/null +++ b/test/suites/encoding-flags/compact-object/env @@ -0,0 +1 @@ +export JSON_COMPACT=1 diff --git a/test/suites/encoding-flags/compact-object/input b/test/suites/encoding-flags/compact-object/input new file mode 100644 index 0000000..062e54f --- /dev/null +++ b/test/suites/encoding-flags/compact-object/input @@ -0,0 +1 @@ +{"a": 1, "b": 2} diff --git a/test/suites/encoding-flags/compact-object/output b/test/suites/encoding-flags/compact-object/output new file mode 100644 index 0000000..73a5d70 --- /dev/null +++ b/test/suites/encoding-flags/compact-object/output @@ -0,0 +1 @@ +{"a":1,"b":2}
\ No newline at end of file diff --git a/test/suites/encoding-flags/ensure-ascii/env b/test/suites/encoding-flags/ensure-ascii/env new file mode 100644 index 0000000..6a0e0aa --- /dev/null +++ b/test/suites/encoding-flags/ensure-ascii/env @@ -0,0 +1 @@ +export JSON_ENSURE_ASCII=1 diff --git a/test/suites/encoding-flags/ensure-ascii/input b/test/suites/encoding-flags/ensure-ascii/input new file mode 100644 index 0000000..69469ce --- /dev/null +++ b/test/suites/encoding-flags/ensure-ascii/input @@ -0,0 +1,8 @@ +[ + "foo", + "å ä ö", + "foo åä", + "åä foo", + "å foo ä", + "clef g: 𝄞" +] diff --git a/test/suites/encoding-flags/ensure-ascii/output b/test/suites/encoding-flags/ensure-ascii/output new file mode 100644 index 0000000..36f8eb5 --- /dev/null +++ b/test/suites/encoding-flags/ensure-ascii/output @@ -0,0 +1 @@ +["foo", "\u00e5 \u00e4 \u00f6", "foo \u00e5\u00e4", "\u00e5\u00e4 foo", "\u00e5 foo \u00e4", "clef g: \ud834\udd1e"]
\ No newline at end of file diff --git a/test/suites/encoding-flags/indent-array/env b/test/suites/encoding-flags/indent-array/env new file mode 100644 index 0000000..273232a --- /dev/null +++ b/test/suites/encoding-flags/indent-array/env @@ -0,0 +1 @@ +export JSON_INDENT=4 diff --git a/test/suites/encoding-flags/indent-array/input b/test/suites/encoding-flags/indent-array/input new file mode 100644 index 0000000..44e2ace --- /dev/null +++ b/test/suites/encoding-flags/indent-array/input @@ -0,0 +1 @@ +[1, 2] diff --git a/test/suites/encoding-flags/indent-array/output b/test/suites/encoding-flags/indent-array/output new file mode 100644 index 0000000..c57d705 --- /dev/null +++ b/test/suites/encoding-flags/indent-array/output @@ -0,0 +1,4 @@ +[ + 1, + 2 +]
\ No newline at end of file diff --git a/test/suites/encoding-flags/indent-compact-array/env b/test/suites/encoding-flags/indent-compact-array/env new file mode 100644 index 0000000..89c9f78 --- /dev/null +++ b/test/suites/encoding-flags/indent-compact-array/env @@ -0,0 +1,2 @@ +export JSON_INDENT=4 +export JSON_COMPACT=1 diff --git a/test/suites/encoding-flags/indent-compact-array/input b/test/suites/encoding-flags/indent-compact-array/input new file mode 100644 index 0000000..44e2ace --- /dev/null +++ b/test/suites/encoding-flags/indent-compact-array/input @@ -0,0 +1 @@ +[1, 2] diff --git a/test/suites/encoding-flags/indent-compact-array/output b/test/suites/encoding-flags/indent-compact-array/output new file mode 100644 index 0000000..c57d705 --- /dev/null +++ b/test/suites/encoding-flags/indent-compact-array/output @@ -0,0 +1,4 @@ +[ + 1, + 2 +]
\ No newline at end of file diff --git a/test/suites/encoding-flags/indent-compact-object/env b/test/suites/encoding-flags/indent-compact-object/env new file mode 100644 index 0000000..89c9f78 --- /dev/null +++ b/test/suites/encoding-flags/indent-compact-object/env @@ -0,0 +1,2 @@ +export JSON_INDENT=4 +export JSON_COMPACT=1 diff --git a/test/suites/encoding-flags/indent-compact-object/input b/test/suites/encoding-flags/indent-compact-object/input new file mode 100644 index 0000000..062e54f --- /dev/null +++ b/test/suites/encoding-flags/indent-compact-object/input @@ -0,0 +1 @@ +{"a": 1, "b": 2} diff --git a/test/suites/encoding-flags/indent-compact-object/output b/test/suites/encoding-flags/indent-compact-object/output new file mode 100644 index 0000000..9cc4294 --- /dev/null +++ b/test/suites/encoding-flags/indent-compact-object/output @@ -0,0 +1,4 @@ +{ + "a":1, + "b":2 +}
\ No newline at end of file diff --git a/test/suites/encoding-flags/indent-object/env b/test/suites/encoding-flags/indent-object/env new file mode 100644 index 0000000..273232a --- /dev/null +++ b/test/suites/encoding-flags/indent-object/env @@ -0,0 +1 @@ +export JSON_INDENT=4 diff --git a/test/suites/encoding-flags/indent-object/input b/test/suites/encoding-flags/indent-object/input new file mode 100644 index 0000000..062e54f --- /dev/null +++ b/test/suites/encoding-flags/indent-object/input @@ -0,0 +1 @@ +{"a": 1, "b": 2} diff --git a/test/suites/encoding-flags/indent-object/output b/test/suites/encoding-flags/indent-object/output new file mode 100644 index 0000000..0fbddba --- /dev/null +++ b/test/suites/encoding-flags/indent-object/output @@ -0,0 +1,4 @@ +{ + "a": 1, + "b": 2 +}
\ No newline at end of file diff --git a/test/suites/encoding-flags/object/input b/test/suites/encoding-flags/object/input new file mode 100644 index 0000000..062e54f --- /dev/null +++ b/test/suites/encoding-flags/object/input @@ -0,0 +1 @@ +{"a": 1, "b": 2} diff --git a/test/suites/encoding-flags/object/output b/test/suites/encoding-flags/object/output new file mode 100644 index 0000000..ecd219f --- /dev/null +++ b/test/suites/encoding-flags/object/output @@ -0,0 +1 @@ +{"a": 1, "b": 2}
\ No newline at end of file |