diff options
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/jq_old_tests.py | 9 | ||||
| -rw-r--r-- | tests/jq_tests.py | 11 |
2 files changed, 15 insertions, 5 deletions
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 <top-level>, 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 <top-level>, 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 <top-level>, 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 <top-level>, 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 <top-level>, 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 <top-level>, 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(): |
