4 def WebIDLTest(parser
, harness
):
5 # Check that error messages put the '^' in the right place.
13 /* This is also a comment. */
18 except WebIDL
.WebIDLError
as e
:
20 lines
= str(e
).split("\n")
22 harness
.check(len(lines
), 3, "Expected number of lines in error message")
24 lines
[0].endswith("line 6:10"),
25 'First line of error should end with "line 6:10", but was "%s".' % lines
[0],
30 "Second line of error message is the line which caused the error.",
34 " " * (len("interface ?") - 1) + "^",
35 "Correct column pointer in error message.",
38 harness
.ok(threw
, "Should have thrown.")