summaryrefslogtreecommitdiff
path: root/test/unit/test_parsing_error.py
blob: c9128045ef090f250e899e00250abb4130ee04cd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
import os

from scripts.test import shared
from . import utils


class ParsingErrorTest(utils.BinaryenTestCase):
    def test_parsing_error_msg(self):
        module = '''
(module
  (func $foo
    (abc)
  )
)
'''
        p = shared.run_process(shared.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)