summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMichael Williamson <mike@zwobble.org>2023-03-16 13:15:58 +0000
committerMichael Williamson <mike@zwobble.org>2023-03-16 13:15:58 +0000
commit125196c17a00311ce132148369982795e2d229ce (patch)
treeb7644eae1b0cd517a380c59f71a43c6efef470bb /tests
parent228d02c34d5945daebef128f1b652e3005f709d5 (diff)
Handle decoding of strings containing null bytes
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 bcacdca..e5b0b5e 100644
--- a/tests/jq_tests.py
+++ b/tests/jq_tests.py
@@ -247,6 +247,13 @@ class TestJvToPython(object):
assert_equal("x", program.input(text='"x"').first())
assert_equal("xyz", program.input(text='"xyz"').first())
+ def test_strings_containing_null_characters_are_preserved(self):
+ program = jq.compile(".")
+
+ result = program.input("a\x00b").first()
+
+ assert_equal("a\x00b", result)
+
def test_program_preserves_arrays(self):
program = jq.compile(".")