From 805705dde4beb9db9a1743663d415198fb02eb1a Mon Sep 17 00:00:00 2001 From: Michael Williamson Date: Sun, 10 Sep 2023 10:57:30 +0100 Subject: Update to jq 1.7 --- tests/jq_old_tests.py | 9 +++++++-- tests/jq_tests.py | 11 ++++++++--- 2 files changed, 15 insertions(+), 5 deletions(-) (limited to 'tests') diff --git a/tests/jq_old_tests.py b/tests/jq_old_tests.py index f7e1f0d..9393cce 100644 --- a/tests/jq_old_tests.py +++ b/tests/jq_old_tests.py @@ -74,8 +74,13 @@ def test_value_error_is_raised_if_program_is_invalid(): jq("!") assert False, "Expected error" except ValueError as error: - expected_error_str = "jq: error: syntax error, unexpected INVALID_CHARACTER, expecting $end (Unix shell quoting issues?) at , line 1:\n!\njq: 1 compile error" - assert_equal(str(error), expected_error_str) + expected_error_strs = [ + # jq 1.6 + "jq: error: syntax error, unexpected INVALID_CHARACTER, expecting $end (Unix shell quoting issues?) at , line 1:\n!\njq: 1 compile error", + # jq 1.7 + "jq: error: syntax error, unexpected INVALID_CHARACTER, expecting end of file (Unix shell quoting issues?) at , line 1:\n!\njq: 1 compile error", + ] + assert str(error) in expected_error_strs def test_value_error_is_raised_if_input_cannot_be_processed_by_program(): diff --git a/tests/jq_tests.py b/tests/jq_tests.py index bf40679..c911ef5 100644 --- a/tests/jq_tests.py +++ b/tests/jq_tests.py @@ -23,7 +23,7 @@ def test_can_add_one_to_each_element_of_an_array(): def test_nan_is_outputted_as_null(): assert_equal( None, - jq.compile("0/0").input(0).first(), + jq.compile("nan").input(0).first(), ) @@ -194,8 +194,13 @@ def test_value_error_is_raised_if_program_is_invalid(): jq.compile("!") assert False, "Expected error" except ValueError as error: - expected_error_str = "jq: error: syntax error, unexpected INVALID_CHARACTER, expecting $end (Unix shell quoting issues?) at , line 1:\n!\njq: 1 compile error" - assert_equal(str(error), expected_error_str) + expected_error_strs = [ + # jq 1.6 + "jq: error: syntax error, unexpected INVALID_CHARACTER, expecting $end (Unix shell quoting issues?) at , line 1:\n!\njq: 1 compile error", + # jq 1.7 + "jq: error: syntax error, unexpected INVALID_CHARACTER, expecting end of file (Unix shell quoting issues?) at , line 1:\n!\njq: 1 compile error", + ] + assert str(error) in expected_error_strs def test_value_error_is_raised_if_input_cannot_be_processed_by_program(): -- cgit v1.2.3