summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMichael Williamson <mike@zwobble.org>2023-09-10 10:57:30 +0100
committerMichael Williamson <mike@zwobble.org>2023-09-10 10:57:30 +0100
commit805705dde4beb9db9a1743663d415198fb02eb1a (patch)
treee75f0d81c79bb0ee05e87d0aadbd548673106bbe /tests
parente3ca07410215abdbf457dbd1b430d5111e98d85a (diff)
Update to jq 1.7
Diffstat (limited to 'tests')
-rw-r--r--tests/jq_old_tests.py9
-rw-r--r--tests/jq_tests.py11
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():