mirror of
https://github.com/gnosygnu/xowa.git
synced 2024-10-27 20:34:16 +00:00
Luaj: Reinstate next
variable for frontier matches [#732]
This commit is contained in:
parent
f760fd9cd0
commit
be072de8d9
@ -145,6 +145,13 @@ public class Scrib_lib_ustring__gsub__tst {
|
|||||||
fxt.Init__cbk(proc);
|
fxt.Init__cbk(proc);
|
||||||
Exec_gsub(text, regx, -1, proc.To_scrib_lua_proc(), "aBYz;2");
|
Exec_gsub(text, regx, -1, proc.To_scrib_lua_proc(), "aBYz;2");
|
||||||
}
|
}
|
||||||
|
@Test public void Luacbk__balanced() { // PURPOSE:LUAJ_PATTERN_REPLACEMENT; DATE:2019-04-16
|
||||||
|
String text = "}a{{b}}c{{d}}";
|
||||||
|
String regx = "%b{}"; // "()" is anypos, which inserts find_pos to results
|
||||||
|
Mock_proc__verify_args proc = new Mock_proc__verify_args(0, new Object[]{"x", "{{b}}"}, new Object[]{"y", "{{d}}"});
|
||||||
|
fxt.Init__cbk(proc);
|
||||||
|
Exec_gsub(text, regx, -1, proc.To_scrib_lua_proc(), "}axcy;2");
|
||||||
|
}
|
||||||
@Test public void Luacbk__anypos() {
|
@Test public void Luacbk__anypos() {
|
||||||
String text = "ad2f1e3z";
|
String text = "ad2f1e3z";
|
||||||
String regx = "()([1d])([2e])([3f])"; // "()" is anypos, which inserts find_pos to results
|
String regx = "()([1d])([2e])([3f])"; // "()" is anypos, which inserts find_pos to results
|
||||||
@ -156,21 +163,14 @@ public class Scrib_lib_ustring__gsub__tst {
|
|||||||
}
|
}
|
||||||
@Test public void Luacbk__frontier__eos() { // PURPOSE:frontier pattern should not match end of string; ISSUE#:732; DATE:2020-05-28
|
@Test public void Luacbk__frontier__eos() { // PURPOSE:frontier pattern should not match end of string; ISSUE#:732; DATE:2020-05-28
|
||||||
String text = "a";
|
String text = "a";
|
||||||
String regx = "([a])(%f[%s])";
|
String regx = "(a)(%f[%s])";
|
||||||
String expd = "a;0"; // fails if "b;0"
|
String expd = "a;0"; // fails if "b;0" when below is uncommented
|
||||||
Mock_proc__verify_args proc = new Mock_proc__verify_args(0
|
Mock_proc__verify_args proc = new Mock_proc__verify_args(0
|
||||||
//, new Object[]{"b", "a", ""} // NOTE: used to require these parameters
|
//, new Object[]{"b", "a", ""} // NOTE: used to require these parameters
|
||||||
);
|
);
|
||||||
fxt.Init__cbk(proc);
|
fxt.Init__cbk(proc);
|
||||||
Exec_gsub(text, regx, -1, proc.To_scrib_lua_proc(), expd);
|
Exec_gsub(text, regx, -1, proc.To_scrib_lua_proc(), expd);
|
||||||
}
|
}
|
||||||
@Test public void Luacbk__balanced() { // PURPOSE:LUAJ_PATTERN_REPLACEMENT; DATE:2019-04-16
|
|
||||||
String text = "}a{{b}}c{{d}}";
|
|
||||||
String regx = "%b{}"; // "()" is anypos, which inserts find_pos to results
|
|
||||||
Mock_proc__verify_args proc = new Mock_proc__verify_args(0, new Object[]{"x", "{{b}}"}, new Object[]{"y", "{{d}}"});
|
|
||||||
fxt.Init__cbk(proc);
|
|
||||||
Exec_gsub(text, regx, -1, proc.To_scrib_lua_proc(), "}axcy;2");
|
|
||||||
}
|
|
||||||
// Mock_proc__verify_args proc = new Mock_proc__verify_args(0, new Object[]{"x", "{{yes2}}"}, new Object[]{"x", "{{flagicon|USA}}"});
|
// Mock_proc__verify_args proc = new Mock_proc__verify_args(0, new Object[]{"x", "{{yes2}}"}, new Object[]{"x", "{{flagicon|USA}}"});
|
||||||
// fxt.Init__cbk(proc);
|
// fxt.Init__cbk(proc);
|
||||||
// Exec_gsub("}\n|-\n|28\n|{{yes2}}Win\n|28–0\n|style=\"text-align:left;\"|{{flagicon|USA}}", "%b{}", -1, proc.To_scrib_lua_proc(), "}axbx;2"); }
|
// Exec_gsub("}\n|-\n|28\n|{{yes2}}Win\n|28–0\n|style=\"text-align:left;\"|{{flagicon|USA}}", "%b{}", -1, proc.To_scrib_lua_proc(), "}axbx;2"); }
|
||||||
|
Binary file not shown.
Loading…
Reference in New Issue
Block a user