Fix bug 3495802 to return correct offset of substrings from string.find()
This commit is contained in:
@@ -560,5 +560,14 @@ public class FragmentsTest extends TestSuite {
|
||||
runFragment( LuaValue.varargsOf(LuaValue.FALSE, LuaValue.NIL),
|
||||
"return pcall(error)\n");
|
||||
}
|
||||
|
||||
|
||||
public void testFindWithOffset() {
|
||||
runFragment(LuaValue.varargsOf(LuaValue.valueOf(8), LuaValue.valueOf(5)),
|
||||
"string = \"abcdef:ghi\"\n" +
|
||||
"substring = string:sub(3)\n" +
|
||||
"idx = substring:find(\":\")\n" +
|
||||
"return #substring, idx\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user