From 125196c17a00311ce132148369982795e2d229ce Mon Sep 17 00:00:00 2001 From: Michael Williamson Date: Thu, 16 Mar 2023 13:15:58 +0000 Subject: Handle decoding of strings containing null bytes --- tests/jq_tests.py | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'tests') 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(".") -- cgit v1.2.3