blob: dce25718990427116cc1fba1ac403e00010a37a7 [file] [log] [blame]
description("Tests error messages to make sure that they're sane");
function parseTest(source)
{
try {
eval(source);
} catch (e) {
return e.message
}
}
shouldBe("parseTest('0x')", "\"No hexadecimal digits after '0x'\"");
shouldBe("parseTest('0xg')", "\"No hexadecimal digits after '0x'\"");
shouldBe("parseTest('0x1.2')", "\"Unexpected number '.2'. Parse error.\"");
shouldBe("parseTest('0x1g')", "\"No space between hexadecimal literal and identifier\"");
shouldBe("parseTest('0x1in')", "\"No space between hexadecimal literal and identifier\"");