summaryrefslogtreecommitdiff
path: root/test/unit/test_parsing_error.py
diff options
context:
space:
mode:
Diffstat (limited to 'test/unit/test_parsing_error.py')
-rw-r--r--test/unit/test_parsing_error.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/test/unit/test_parsing_error.py b/test/unit/test_parsing_error.py
new file mode 100644
index 000000000..93aab1d16
--- /dev/null
+++ b/test/unit/test_parsing_error.py
@@ -0,0 +1,18 @@
+from scripts.test.shared import WASM_OPT, run_process
+from utils import BinaryenTestCase
+import os
+
+
+class ParsingErrorTest(BinaryenTestCase):
+ def test_parsing_error_msg(self):
+ module = '''
+ (module
+ (func $foo
+ (abc)
+ )
+ )
+ '''
+ p = run_process(WASM_OPT + ['--print', '-o', os.devnull], input=module,
+ check=False, capture_output=True)
+ self.assertNotEqual(p.returncode, 0)
+ self.assertIn("parse exception: abc (at 4:6)", p.stderr)