diff options
| author | Michael Williamson <mike@zwobble.org> | 2024-03-10 12:09:13 +0000 |
|---|---|---|
| committer | Michael Williamson <mike@zwobble.org> | 2024-03-16 17:54:24 +0000 |
| commit | 6ea34a4435fa549ea14c37b937d17af607afd6d4 (patch) | |
| tree | a3d6d0c42772d8101ca456a38f5068bb349df3a0 /tests | |
| parent | b345d2c75c0768ba8e58d75e69721d3b97564463 (diff) | |
Update to jq 1.7.1
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/jq_tests.py | 16 |
1 files changed, 13 insertions, 3 deletions
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(".") |
