From 6ea34a4435fa549ea14c37b937d17af607afd6d4 Mon Sep 17 00:00:00 2001 From: Michael Williamson Date: Sun, 10 Mar 2024 12:09:13 +0000 Subject: Update to jq 1.7.1 --- tests/jq_tests.py | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'tests') diff --git a/tests/jq_tests.py b/tests/jq_tests.py index c911ef5..62b3ae0 100644 --- a/tests/jq_tests.py +++ b/tests/jq_tests.py @@ -319,9 +319,19 @@ class TestJvToPython(object): def test_given_json_text_then_strings_containing_null_characters_are_preserved(self): program = jq.compile(".") - result = program.input(text='"a\x00b"').first() - - assert_equal("a\x00b", result) + # Before jq 1.7.1, we expect jq to accept the literal null character. + # From jq 1.7.1, we expect jq to reject the literal null character. + + try: + result = program.input(text='"a\x00b"').first() + + assert_equal("a\x00b", result) + except ValueError as error: + assert_equal( + "parse error: Invalid string: control characters from U+0000 " + + "through U+001F must be escaped at line 1, column 5", + str(error), + ) def test_program_preserves_arrays(self): program = jq.compile(".") -- cgit v1.2.3