summaryrefslogtreecommitdiff
path: root/test/unit/test_parsing_error.py
diff options
context:
space:
mode:
authorHeejin Ahn <aheejin@gmail.com>2019-05-24 12:44:50 -0700
committerGitHub <noreply@github.com>2019-05-24 12:44:50 -0700
commit7ae38053cf1e1e5c8f84c34a142efb043f6d4810 (patch)
tree6206f285e01f637a0698d693ce47a9493c911ed4 /test/unit/test_parsing_error.py
parent5644d15b87577478659d7cbeb9bb0555cc233631 (diff)
downloadbinaryen-7ae38053cf1e1e5c8f84c34a142efb043f6d4810.tar.gz
binaryen-7ae38053cf1e1e5c8f84c34a142efb043f6d4810.tar.bz2
binaryen-7ae38053cf1e1e5c8f84c34a142efb043f6d4810.zip
Show line/col for parsing exceptions in gen-s-parser (#2138)
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)