1
0
mirror of https://github.com/gnosygnu/xowa.git synced 2026-03-02 03:49:30 +00:00

'v3.5.1.1'

This commit is contained in:
gnosygnu
2016-05-01 21:06:12 -04:00
parent 5ce4ea2a08
commit 96636f3161
131 changed files with 2287 additions and 928 deletions

View File

@@ -38,9 +38,9 @@ public class Pfunc_scrib_lib implements Scrib_lib {
}
private static final int Proc_expr = 0;
public static final String Invk_expr = "expr";
private static final String[] Proc_names = String_.Ary(Invk_expr);
private static final String[] Proc_names = String_.Ary(Invk_expr);
public boolean Expr(Scrib_proc_args args, Scrib_proc_rslt rslt) {
byte[] expr_bry = args.Pull_bry(0);
byte[] expr_bry = args.Xstr_bry_or_null(0); // NOTE: some modules will pass in an int; PAGE:en.w:531_BC DATE:2016-04-29
Bry_bfr tmp_bfr = core.Wiki().Utl__bfr_mkr().Get_b128();
Pfunc_expr.Evaluate(tmp_bfr, core.Ctx(), expr_bry);
String expr_rslt = tmp_bfr.To_str_and_rls();

View File

@@ -28,6 +28,9 @@ public class Pfunc_scrib_lib_tst {
@Test public void Expr__pass() {
fxt.Test_scrib_proc_str(lib, Pfunc_scrib_lib.Invk_expr, Object_.Ary("1 + 2") , "3");
}
@Test public void Expr__int() {
fxt.Test_scrib_proc_str(lib, Pfunc_scrib_lib.Invk_expr, Object_.Ary(3) , "3"); // int should not cause class cast error; PAGE:en.w:531_BC; DATE:2016-04-29
}
@Test public void Expr__fail() { // PURPOSE: if bad input don't throw error; return error message; PAGE:es.w:Freer_(Texas) DATE:2015-07-28
fxt.Test_scrib_proc_str(lib, Pfunc_scrib_lib.Invk_expr, Object_.Ary("fail") , "<strong class=\"error\">Expression error: Unrecognised word \"fail\"</strong>");
}