summaryrefslogtreecommitdiff
path: root/test/unit/test_parsing_error.py
blob: b9bab3d763f49427014d25e5871ea893f0e16457 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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:4)", p.stderr)