Fixed issue: #74
This commit is contained in:
@@ -189,6 +189,26 @@ public class FragmentsTest extends TestSuite {
|
||||
assertEquals("interrupted", thrown.get().getMessage());
|
||||
}
|
||||
|
||||
public void testBareExpressionReportsReadableToken() {
|
||||
Globals globals = JsePlatform.debugGlobals();
|
||||
try {
|
||||
globals.load("1 + 1", "expr.lua");
|
||||
fail("expected syntax error");
|
||||
} catch (LuaError e) {
|
||||
assertTrue(e.getMessage().contains("unexpected symbol near 1"));
|
||||
}
|
||||
}
|
||||
|
||||
public void testUnfinishedTableReportsEof() {
|
||||
Globals globals = JsePlatform.debugGlobals();
|
||||
try {
|
||||
globals.load("mytab = {", "table.lua");
|
||||
fail("expected syntax error");
|
||||
} catch (LuaError e) {
|
||||
assertTrue(e.getMessage().contains("near <eof>"));
|
||||
}
|
||||
}
|
||||
|
||||
public void testLongIntegerLiteralPrecision() {
|
||||
runFragment(
|
||||
LuaValue.varargsOf(new LuaValue[] {
|
||||
|
||||
Reference in New Issue
Block a user