Fixed issue: #94
This commit is contained in:
@@ -591,6 +591,17 @@ public class FragmentsTest extends TestSuite {
|
||||
runFragment(LuaValue.varargsOf(LuaValue.valueOf("boolean"), LuaValue.TRUE),
|
||||
"a,b = pcall(error, true); return type(b), b\n");
|
||||
}
|
||||
public void testXpcallHandlerResultReplacesStringError() {
|
||||
runFragment(LuaValue.varargsOf(LuaValue.valueOf("table"), LuaValue.valueOf(1)),
|
||||
"local ok, err = xpcall(function() error('oh no') end, function(e) return { marker = 1, original = e } end)\n" +
|
||||
"return type(err), err.marker\n");
|
||||
}
|
||||
public void testXpcallHandlerGetsOriginalErrorObject() {
|
||||
runFragment(LuaValue.varargsOf(LuaValue.valueOf("table"), LuaValue.valueOf(1)),
|
||||
"local source = { marker = 1 }\n" +
|
||||
"local ok, err = xpcall(function() error(source) end, function(e) return e end)\n" +
|
||||
"return type(err), err.marker\n");
|
||||
}
|
||||
public void testBalancedMatchOnEmptyString() {
|
||||
runFragment(LuaValue.NIL, "return (\"\"):match(\"%b''\")\n");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user