From db174ba0448a0716daa2e661fafde7d236429b03 Mon Sep 17 00:00:00 2001 From: Michael Williamson Date: Thu, 27 Mar 2014 13:47:12 +0000 Subject: Capture compilation errors --- tests/jq_tests.py | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'tests') 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("!")) -- cgit v1.2.3