summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMichael Williamson <mike@zwobble.org>2023-03-16 13:17:47 +0000
committerMichael Williamson <mike@zwobble.org>2023-03-16 13:30:29 +0000
commit7a2648dfe150f532d1690fa8fbaf588789afaa84 (patch)
treed299bf6fc98e86b841c2cce769b996f5abe1ab3e /tests
parent125196c17a00311ce132148369982795e2d229ce (diff)
Handle null bytes in object keys
Diffstat (limited to 'tests')
-rw-r--r--tests/jq_tests.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/jq_tests.py b/tests/jq_tests.py
index e5b0b5e..5b8e630 100644
--- a/tests/jq_tests.py
+++ b/tests/jq_tests.py
@@ -308,6 +308,13 @@ class TestJvToPython(object):
assert_equal({"a": {}, "b": {}}, program.input(text='{"a": {}, "b": {}}').first())
assert_equal({"": {"": {}}}, program.input(text='{"": {"": {}}}').first())
+ def test_object_keys_containing_null_characters_are_preserved(self):
+ program = jq.compile(".")
+
+ result = program.input({"a\x00b": None}).first()
+
+ assert_equal({"a\x00b": None}, result)
+
class TestConvenienceFunctions(object):
def test_first_function_with_json_value_input_returns_first_output_element(self):