diff options
| author | Michael Williamson <mike@zwobble.org> | 2014-03-27 13:47:12 +0000 |
|---|---|---|
| committer | Michael Williamson <mike@zwobble.org> | 2014-03-27 13:47:12 +0000 |
| commit | db174ba0448a0716daa2e661fafde7d236429b03 (patch) | |
| tree | d0f5e6af550f39c7cd071e71a01801f72a663182 /tests | |
| parent | e852154e744381b9a18fdbc48ff5864e18dfb295 (diff) | |
Capture compilation errors
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/jq_tests.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/jq_tests.py b/tests/jq_tests.py index 192c4db..dfb7112 100644 --- a/tests/jq_tests.py +++ b/tests/jq_tests.py @@ -71,6 +71,14 @@ def multiple_inputs_in_raw_input_are_separated_by_newlines(): @istest def value_error_is_raised_if_program_is_invalid(): + try: + jq("!") + assert False, "Expected error" + except ValueError as error: + expected_error_str = """error: syntax error, unexpected INVALID_CHARACTER, expecting $end +! +1 compile error""" + assert_equal(str(error), expected_error_str) assert_raises(ValueError, lambda: jq("!")) |
