1
0
mirror of https://github.com/gnosygnu/xowa.git synced 2024-10-27 20:34:16 +00:00

Parser.Ref: Change UNIQ prefix / suffix

This commit is contained in:
gnosygnu 2017-03-31 08:04:08 -04:00
parent 3441135fad
commit f57fd74e13
2 changed files with 13 additions and 13 deletions

View File

@ -124,8 +124,8 @@ public class Xop_uniq_mgr { // REF.MW:/parser/StripState.php
}
private static final byte[]
Bry__uniq__bgn = Bry_.new_a7("\u007fUNIQ")
, Bry__uniq__bgn_w_dash = Bry_.new_a7("\u007fUNIQ-")
, Bry__uniq__add__end = Bry_.new_a7("--QINU\u007f")
Bry__uniq__bgn = Bry_.new_a7("\u007f'\"`UNIQ-")
, Bry__uniq__bgn_w_dash = Bry_.Add(Bry__uniq__bgn, Byte_ascii.Dash_bry)
, Bry__uniq__add__end = Bry_.new_a7("-QINU`\"'\u007f")
;
}

View File

@ -20,38 +20,38 @@ public class Xop_uniq_mgr__tst {
@Before public void init() {fxt.Init();}
@Test public void Test__random_bry() {
fxt.Init_random_int_ary(Int_.Ary(240563374, 22728940, 1451248133));
fxt.Test__uniq_bry_new("UNIQE56B4AE15AD0EC68");
fxt.Test__uniq_bry_new("'\"`UNIQ-E56B4AE15AD0EC68");
fxt.Init_random_int_ary(Int_.Ary(1363621437, 426295411, 421041101));
fxt.Test__uniq_bry_new("UNIQ147363D968C07391");
fxt.Test__uniq_bry_new("'\"`UNIQ-147363D968C07391");
}
@Test public void Add_and_get() {
String expd_key = "UNIQ-item-0--QINU";
String expd_key = "'\"`UNIQ--item-0-QINU`\"'";
fxt.Test__add("a", expd_key);
fxt.Test__get(expd_key, "a");
}
@Test public void Parse__basic() {
String expd_key = "UNIQ-item-0--QINU";
String expd_key = "'\"`UNIQ--item-0-QINU`\"'";
fxt.Test__add("_b_", expd_key);
fxt.Test__parse("a" + expd_key + "c", "a_b_c");
}
@Test public void Parse__recurse() {
String key_0 = "UNIQ-item-0--QINU";
String key_1 = "UNIQ-item-1--QINU";
String key_2 = "UNIQ-item-2--QINU";
String key_0 = "'\"`UNIQ--item-0-QINU`\"'";
String key_1 = "'\"`UNIQ--item-1-QINU`\"'";
String key_2 = "'\"`UNIQ--item-2-QINU`\"'";
fxt.Test__add("0", key_0);
fxt.Test__add("1-" + key_0 + "-1", key_1);
fxt.Test__add("2-" + key_1 + "-2", key_2);
fxt.Test__parse("3-" + key_2 + "-3", "3-2-1-0-1-2-3");
}
@Test public void Convert() {
String key = "UNIQ-item-0--QINU";
String key = "'\"`UNIQ--item-0-QINU`\"'";
fxt.Test__add("2", key);
fxt.Test__convert("1" + key + "3", "123");
}
@Test public void Convert__many() {
String key_0 = "UNIQ-item-0--QINU";
String key_1 = "UNIQ-item-1--QINU";
String key_0 = "'\"`UNIQ--item-0-QINU`\"'";
String key_1 = "'\"`UNIQ--item-1-QINU`\"'";
fxt.Test__add("0", key_0);
fxt.Test__add("1", key_1);
fxt.Test__convert("a " + key_0 + " b " + key_1 + " c", "a 0 b 1 c");