blob: dce25718990427116cc1fba1ac403e00010a37a7 [file] [log] [blame]
oliver@apple.com09aca112014-06-17 22:29:56 +00001description("Tests error messages to make sure that they're sane");
2
3function parseTest(source)
4{
5 try {
6 eval(source);
7 } catch (e) {
8 return e.message
9 }
10}
11
12shouldBe("parseTest('0x')", "\"No hexadecimal digits after '0x'\"");
13shouldBe("parseTest('0xg')", "\"No hexadecimal digits after '0x'\"");
14shouldBe("parseTest('0x1.2')", "\"Unexpected number '.2'. Parse error.\"");
15shouldBe("parseTest('0x1g')", "\"No space between hexadecimal literal and identifier\"");
16shouldBe("parseTest('0x1in')", "\"No space between hexadecimal literal and identifier\"");
17