Bug 1915045 Ensure decode tasks are scheduled on BufferingState::Enter() r=media...
[gecko.git] / dom / bindings / parser / tests / test_error_colno.py
blobb08ba7cc172bb6abb21677134fa4082dc94da68b
1 import WebIDL
4 def WebIDLTest(parser, harness):
5 # Check that error messages put the '^' in the right place.
7 threw = False
8 input = "interface ?"
9 try:
10 parser.parse(input)
11 parser.finish()
12 except WebIDL.WebIDLError as e:
13 threw = True
14 lines = str(e).split("\n")
16 harness.check(len(lines), 3, "Expected number of lines in error message")
17 harness.check(lines[1], input, "Second line shows error")
18 harness.check(
19 lines[2],
20 " " * (len(input) - 1) + "^",
21 "Correct column pointer in error message",
24 harness.ok(threw, "Should have thrown.")