1
0
mirror of https://github.com/gnosygnu/xowa.git synced 2026-03-02 03:49:30 +00:00
This commit is contained in:
gnosygnu
2014-08-03 23:31:22 -04:00
parent 7b6e65b088
commit fb8c06c560
191 changed files with 1869 additions and 722 deletions

View File

@@ -18,13 +18,13 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
package gplx.gfml; import gplx.*;
import org.junit.*;
public class GfmlDataRdr_tst {
@Test public void Raw() {
@Test public void Raw() {
raw = "root:{}";
rdr = rdr_(raw);
Tfds.Eq(rdr.NameOfNode(), "root");
}
@Test public void Atrs() {
@Test public void Atrs() {
raw = "root:id=1 name=me isPresent=true dateOf='2006-12-08';";
rdr = rdr_(raw);
@@ -33,7 +33,7 @@ public class GfmlDataRdr_tst {
Tfds.Eq(rdr.ReadBool("isPresent"), true);
Tfds.Eq_date(rdr.ReadDate("dateOf"), DateAdp_.parse_gplx("2006-12-08"));
}
@Test public void Subs() {
@Test public void Subs() {
raw = String_.Concat_any(
"root:{",
" computers:id=1 {",
@@ -65,7 +65,7 @@ public class GfmlDataRdr_tst {
}
Tfds.Eq(idx, 2);
}
@Test public void SelectRdr() {
@Test public void SelectRdr() {
raw = String_.Concat_any(
"root:{",
" person:name=me {}",
@@ -80,7 +80,7 @@ public class GfmlDataRdr_tst {
Tfds.Eq(computer.NameOfNode(), "computer");
Tfds.Eq(computer.ReadStr("brand"), "noname");
}
// @Test public void Subs_byKey() {
// @Test public void Subs_byKey() {
// raw = String_.Concat_any(
// "root:",
// " person=(name=me)",
@@ -91,7 +91,7 @@ public class GfmlDataRdr_tst {
// Tfds.Eq(person.NameOfNode, "person");
// Tfds.Eq(person.ReadStr("name"), "me");
// }
// @Test public void Type() {
// @Test public void Type() {
// raw = String_.Concat_any(
// "root:{",
// " _type:{example{explicit_val; bool_val; int_val; string_val; long_val; date_val; float_val; decimal_val;}}",

View File

@@ -21,24 +21,24 @@ public class z011_IntObjHash_tst {
@Before public void setup() {
hash = new IntObjHash_base();
} IntObjHash_base hash;
@Test public void Empty() {
@Test public void Empty() {
tst_Count(0);
tst_Fetch(1, null);
}
@Test public void Add() {
@Test public void Add() {
hash.Add(1, "1");
tst_Count(1);
tst_Fetch(1, "1");
tst_Fetch(2, null);
}
@Test public void Del() {
@Test public void Del() {
hash.Add(1, "1");
hash.Del(1);
tst_Count(0);
tst_Fetch(1, null);
}
@Test public void Clear() {
@Test public void Clear() {
hash.Add(1, "1");
hash.Add(32, "32");
tst_Fetch(1, "1");
@@ -50,7 +50,7 @@ public class z011_IntObjHash_tst {
tst_Fetch(2, null);
tst_Fetch(32, null);
}
@Test public void Add_bug() { // fails after expanding ary, and fetching at key=n*16
@Test public void Add_bug() { // fails after expanding ary, and fetching at key=n*16
hash.Add(1, "1");
tst_Count(1);
tst_Fetch(1, "1");

View File

@@ -22,28 +22,28 @@ public class z012_GfmlTrie_tst {
@Before public void setup() {
trie = GfmlTrie.new_();
} GfmlTrie trie;
@Test public void Null() {
@Test public void Null() {
tst_FindMatch_first("", null);
tst_FindMatch_first("{", null);
}
@Test public void OneChar() {
@Test public void OneChar() {
trie.Add("{", "val0");
tst_FindMatch_first("{", "val0");
tst_FindMatch_first(":", null);
}
@Test public void TwoChar() {
@Test public void TwoChar() {
trie.Add("/*", "val0");
tst_FindMatch_first("/*", "val0");
tst_FindMatch_first("//", null);
}
@Test public void ManySym() {
@Test public void ManySym() {
trie.Add(":", "val0");
trie.Add("{", "val1");
tst_FindMatch_first(":", "val0");
tst_FindMatch_first("{", "val1");
tst_FindMatch_first("-", null);
}
@Test public void Overlap_1_2() {
@Test public void Overlap_1_2() {
trie.Add("[", "val0");
trie.Add("[:", "val1");
tst_FindMatch_first("[", "val0");
@@ -51,7 +51,7 @@ public class z012_GfmlTrie_tst {
tst_FindMatch_first("[-", "val0");
tst_FindMatch_first(":", null);
}
@Test public void Overlap_2_1() {
@Test public void Overlap_2_1() {
trie.Add("[:", "val0");
trie.Add("[", "val1");
tst_FindMatch_first("[:", "val0");
@@ -59,7 +59,7 @@ public class z012_GfmlTrie_tst {
tst_FindMatch_first("[-", "val1");
tst_FindMatch_first(":", null);
}
@Test public void Overlap_1_1() {
@Test public void Overlap_1_1() {
trie.Add("[", "val0");
trie.Add("[", "val1");
tst_FindMatch_first("[", "val1"); // return last added

View File

@@ -19,29 +19,29 @@ package gplx.gfml; import gplx.*;
import org.junit.*;
public class z015_GfmlDocPos_tst {
GfmlDocPos root = GfmlDocPos_.Root;
@Test public void Root() {
@Test public void Root() {
tst_Path(root, "0");
}
@Test public void MoveDown() {
@Test public void MoveDown() {
tst_Path(root.NewDown(0), "0_0");
tst_Path(root.NewDown(0).NewDown(0), "0_0_0");
tst_Path(root.NewDown(1).NewDown(2), "0_1_2");
}
@Test public void MoveUp() {
@Test public void MoveUp() {
tst_Path(root.NewDown(1).NewDown(2).NewUp(), "0_1");
}
@Test public void CompareTo_same() {
@Test public void CompareTo_same() {
GfmlDocPos lhs = root.NewDown(0);
GfmlDocPos rhs = root.NewDown(0);
tst_CompareTo(lhs, rhs, CompareAble_.Same);
}
@Test public void CompareTo_diffIndex() {
@Test public void CompareTo_diffIndex() {
GfmlDocPos lhs = root.NewDown(0);
GfmlDocPos rhs = root.NewDown(1);
tst_CompareTo(lhs, rhs, CompareAble_.Less);
tst_CompareTo(rhs, lhs, CompareAble_.More);
}
@Test public void CompareTo_diffLevel() {
@Test public void CompareTo_diffLevel() {
GfmlDocPos lhs = root;
GfmlDocPos rhs = root.NewDown(0);
tst_CompareTo(lhs, rhs, CompareAble_.Less);

View File

@@ -21,14 +21,14 @@ public class z016_GfmlScopeList_tst {
@Before public void setup() {
list = GfmlScopeList.new_("test");
} GfmlScopeList list;
@Test public void None() {
@Test public void None() {
tst_Itm(list, GfmlDocPos_.Root, null);
}
@Test public void One() {
@Test public void One() {
run_Add(list, var_("val1"));
tst_Itm(list, GfmlDocPos_.Root, "val1");
}
@Test public void ByPos() {
@Test public void ByPos() {
run_Add(list, var_("val1").DocPos_(docPos_(0, 0)));
run_Add(list, var_("val2").DocPos_(docPos_(0, 0, 0)));
tst_Itm(list, docPos_(0, 0), "val1");

View File

@@ -23,26 +23,26 @@ public class z051_GfmlFldPool_keyed_tst {
GfmlType type = makr.MakeSubType("point", "x", "y", "z");
fldPool = GfmlFldPool.new_(type);
} GfmlFldPool fldPool;
@Test public void PopByKey_inOrder() {
@Test public void PopByKey_inOrder() {
tst_Keyed_PopByKey(fldPool, "x", "x", "y", "z");
}
@Test public void PopByKey_outOfOrder() {
@Test public void PopByKey_outOfOrder() {
tst_Keyed_PopByKey(fldPool, "y", "y", "x", "z");
}
@Test public void PopByKey_unknown() {
@Test public void PopByKey_unknown() {
tst_Keyed_PopByKey(fldPool, "a", GfmlItmKeys.NullKey, "x", "y", "z");
}
@Test public void PopByKey_alreadyRemoved() {
@Test public void PopByKey_alreadyRemoved() {
tst_Keyed_PopByKey(fldPool, "x", "x", "y", "z");
tst_Keyed_PopByKey(fldPool, "x", GfmlItmKeys.NullKey, "y", "z");
}
@Test public void PopByKey_depleted() {
@Test public void PopByKey_depleted() {
tst_Keyed_PopByKey(fldPool, "x", "x", "y", "z");
tst_Keyed_PopByKey(fldPool, "y", "y", "z");
tst_Keyed_PopByKey(fldPool, "z", "z");
tst_Keyed_PopByKey(fldPool, "x", GfmlItmKeys.NullKey);
}
@Test public void PopNext_inOrder() {
@Test public void PopNext_inOrder() {
tst_Keyed_PopNext(fldPool, "x", "y", "z");
tst_Keyed_PopNext(fldPool, "y", "z");
tst_Keyed_PopNext(fldPool, "z");
@@ -52,7 +52,7 @@ public class z051_GfmlFldPool_keyed_tst {
}
catch (Exception exc) {Err_.Noop(exc);}
}
@Test public void PopByKey_PopNext() {
@Test public void PopByKey_PopNext() {
tst_Keyed_PopByKey(fldPool, "y", "y", "x", "z");
tst_Keyed_PopNext(fldPool, "x", "z");
}

View File

@@ -22,45 +22,45 @@ public class z081_GfmlDataWtr_tst {
wtr = GfmlDataWtr.new_();
wtr.WriteNodeBgn("root");
} DataWtr wtr;
@Test public void Basic() {
@Test public void Basic() {
tst_XtoStr(wtr, "root:;");
}
@Test public void Atr_one() {
@Test public void Atr_one() {
wtr.WriteData("key", "data");;
tst_XtoStr(wtr, "root:key='data';");
}
@Test public void Atr_many() {
@Test public void Atr_many() {
wtr.WriteData("key1", "data1");
wtr.WriteData("key2", "data2");
tst_XtoStr(wtr, "root:key1='data1' key2='data2';");
}
@Test public void Nde_one() {
@Test public void Nde_one() {
wtr.WriteNodeBgn("sub0");
tst_XtoStr(wtr, "root:{sub0:;}");
}
@Test public void Nde_many() {
@Test public void Nde_many() {
wtr.WriteNodeBgn("sub0");
wtr.WriteNodeEnd();
wtr.WriteNodeBgn("sub1");
tst_XtoStr(wtr, "root:{sub0:;sub1:;}");
}
@Test public void Nde_nested() {
@Test public void Nde_nested() {
wtr.WriteNodeBgn("sub0");
wtr.WriteNodeBgn("sub1");
tst_XtoStr(wtr, "root:{sub0:{sub1:;}}");
}
@Test public void OneAtrOneNde() {
@Test public void OneAtrOneNde() {
wtr.WriteData("key1", "data1");
wtr.WriteNodeBgn("sub0");
tst_XtoStr(wtr, "root:key1='data1'{sub0:;}");
}
@Test public void OneAtrOneNdeOneAtr() {
@Test public void OneAtrOneNdeOneAtr() {
wtr.WriteData("key1", "data1");
wtr.WriteNodeBgn("sub0");
wtr.WriteData("key2", "data2");
tst_XtoStr(wtr, "root:key1='data1'{sub0:key2='data2';}");
}
@Test public void EscapeQuote() {
@Test public void EscapeQuote() {
wtr.WriteData("key", "data's");;
tst_XtoStr(wtr, "root:key='data''s';");
}

View File

@@ -22,20 +22,20 @@ public class z091_GfmlLxr_basic_tst {
@Before public void setup() {
rootLxr = GfmlLxr_.general_("gfml.root", GfmlTkn_.cmd_("tkn:text", GfmlBldrCmd_.Null));
} GfmlLxr rootLxr;
@Test public void Empty() {
@Test public void Empty() {
tst_Fetch("");
}
@Test public void General() {
@Test public void General() {
tst_Fetch("text", "text");
}
@Test public void Solo() {
@Test public void Solo() {
ini_AddSymbol(",");
tst_Fetch(",", ",");
tst_Fetch(",data0", ",", "data0");
tst_Fetch("data0,", "data0", ",");
tst_Fetch("data0,data1", "data0", ",", "data1");
}
@Test public void Range() {
@Test public void Range() {
ini_AddRange(" ", "\t");
tst_Fetch(" ", " ");
tst_Fetch(" a", " ", "a");

View File

@@ -22,7 +22,7 @@ public class z101_core_ndeInline_tst {
@Before public void setup() {
fx.ini_RootLxr_Add(GfmlDocLxrs.NdeInline_lxr());
}
@Test public void One() {
@Test public void One() {
fx.tst_Doc("a;", fx.nde_().Atru_("a"));
fx.tst_Tkn("a;"
, fx.tkn_grp_
@@ -30,7 +30,7 @@ public class z101_core_ndeInline_tst {
, fx.tkn_itm_(";")
));
}
@Test public void Many() {
@Test public void Many() {
fx.tst_Doc("a;b;"
, fx.nde_().Atru_("a")
, fx.nde_().Atru_("b")

View File

@@ -25,7 +25,7 @@ public class z103_core_elmKey_tst {
, GfmlDocLxrs.ElmKey_lxr()
);
}
@Test public void Basic() {
@Test public void Basic() {
fx.tst_Doc("a=b;", fx.nde_().Atrk_("a", "b"));
fx.tst_Tkn("a=b;"
, fx.tkn_grp_
@@ -34,7 +34,7 @@ public class z103_core_elmKey_tst {
)
);
}
@Test public void Ws() {
@Test public void Ws() {
fx.ini_RootLxr_Add(GfmlDocLxrs.Whitespace_lxr());
fx.tst_Tkn("a = b;"
, fx.tkn_grp_
@@ -43,10 +43,10 @@ public class z103_core_elmKey_tst {
)
);
}
// @Test public void Err_NotNamed() {
// @Test public void Err_NotNamed() {
// fx.tst_Err("=", GfmlOutCmds.DatTkn_notFound_Err_());
// }
// @Test public void Err_NotValued() {
// @Test public void Err_NotValued() {
// fx.tst_Err("a=;", GfmlOutCmds.elmKey_notValued_Err());
// }
}

View File

@@ -25,13 +25,13 @@ public class z112_core_comment1_tst {
, GfmlDocLxrs.Comment1_lxr()
);
}
@Test public void Basic() {
@Test public void Basic() {
fx.tst_Doc("/*a*/");
fx.tst_Tkn("/*a*/"
, fx.tkn_grp_ary_("/*", "a", "*/")
);
}
@Test public void Data() {
@Test public void Data() {
fx.tst_Doc("a;/*b*/", fx.nde_().Atru_("a"));
fx.tst_Tkn("a;/*b*/"
, fx.tkn_grp_
@@ -40,22 +40,22 @@ public class z112_core_comment1_tst {
, fx.tkn_grp_ary_("/*", "b", "*/")
);
}
@Test public void IgnoreWs() {
@Test public void IgnoreWs() {
fx.tst_Tkn("/* b c */"
, fx.tkn_grp_ary_("/*", " b c ", "*/")
);
}
@Test public void EscapeBgn() {
@Test public void EscapeBgn() {
fx.tst_Tkn("/* /*/* */"
, fx.tkn_grp_ary_("/*", " ", "/*/*", " ", "*/")
);
}
@Test public void EscapeEnd() {
@Test public void EscapeEnd() {
fx.tst_Tkn("/* */*/ */"
, fx.tkn_grp_ary_("/*", " ", "*/*/", " ", "*/")
);
}
@Test public void Nest() {
@Test public void Nest() {
fx.tst_Tkn("/* b0 /* c */ b1 */"
, fx.tkn_grp_
( fx.tkn_itm_("/*")

View File

@@ -25,7 +25,7 @@ public class z120_quotes_eval0_tst {
, GfmlDocLxrs.Eval0_lxr()
);
}
@Test public void Basic() {
@Test public void Basic() {
fx.tst_Doc("<~t>;", fx.nde_().Atru_("\t"));
fx.tst_Tkn("<~t>;"
, fx.tkn_grp_
@@ -35,7 +35,7 @@ public class z120_quotes_eval0_tst {
)
);
}
@Test public void DoublingIsNotEscaping() {
@Test public void DoublingIsNotEscaping() {
fx.tst_Doc("<~t>>>;", fx.nde_().Atru_("\t").Atru_(">>")); // >> does not resolve to >
}
}

View File

@@ -25,7 +25,7 @@ public class z121_quotes_quotes0_tst {
, GfmlDocLxrs.Quote0_lxr()
);
}
@Test public void Basic() {
@Test public void Basic() {
fx.tst_Doc("'abc';", fx.nde_().Atru_("abc"));
fx.tst_Tkn("'abc';"
, fx.tkn_grp_
@@ -35,7 +35,7 @@ public class z121_quotes_quotes0_tst {
)
);
}
@Test public void Escape() {
@Test public void Escape() {
fx.tst_Doc("'a''b';", fx.nde_().Atru_("a'b"));
fx.tst_Tkn("'a''b';"
, fx.tkn_grp_
@@ -45,7 +45,7 @@ public class z121_quotes_quotes0_tst {
)
);
}
@Test public void ManyAtrs_LastQuoted() { // bugfix
@Test public void ManyAtrs_LastQuoted() { // bugfix
fx.ini_RootLxr_Add(GfmlDocLxrs.Whitespace_lxr());
fx.tst_Doc("a 'b';", fx.nde_().Atru_("a").Atru_("b"));
}

View File

@@ -25,7 +25,7 @@ public class z122_quotes_quote0_eval0_tst {
, GfmlDocLxrs.Quote0_Eval0_lxr()
);
}
@Test public void Basic() {
@Test public void Basic() {
fx.tst_Doc("'a<~t>b';", fx.nde_().Atru_("a\tb"));
fx.tst_Tkn("'a<~t>b';"
, fx.tkn_grp_
@@ -41,7 +41,7 @@ public class z122_quotes_quote0_eval0_tst {
)
);
}
@Test public void QuoteInside() {
@Test public void QuoteInside() {
fx.tst_Doc("'a<~'t'>b';", fx.nde_().Atru_("a\tb"));
fx.tst_Tkn("'a<~'t'>b';"
, fx.tkn_grp_

View File

@@ -25,16 +25,16 @@ public class z123_quotes_quoteBlock_tst {
, GfmlDocLxrs.QuoteBlock_lxr()
);
}
@Test public void Basic() {
@Test public void Basic() {
fx.tst_Doc("|'abc'|;", fx.nde_().Atru_("abc"));
}
@Test public void Escape_bgn() {
@Test public void Escape_bgn() {
fx.tst_Doc("|'a|'|'b'|;", fx.nde_().Atru_("a|'b"));
}
@Test public void Escape_end() {
@Test public void Escape_end() {
fx.tst_Doc("|'a'|'|b'|;", fx.nde_().Atru_("a'|b"));
}
@Test public void Nest() {
@Test public void Nest() {
fx.tst_Doc("|'a|'-'|b'|;", fx.nde_().Atru_("a-b"));
}
}

View File

@@ -25,29 +25,29 @@ public class z151_ndeSubs_basic_tst {
, GfmlDocLxrs.NdeBodyEnd_lxr()
);
}
@Test public void Basic() {
@Test public void Basic() {
fx.tst_Doc("{}", fx.nde_());
fx.tst_Tkn("{}"
, fx.tkn_grp_ary_("{", "}")
);
}
@Test public void Many() {
@Test public void Many() {
fx.tst_Doc("{}{}", fx.nde_(), fx.nde_());
}
@Test public void Nested() {
@Test public void Nested() {
fx.tst_Doc("{{}}"
, fx.nde_().Subs_
( fx.nde_())
);
}
@Test public void NestedMany() {
@Test public void NestedMany() {
fx.tst_Doc("{{}{}}"
, fx.nde_().Subs_
( fx.nde_()
, fx.nde_()
));
}
@Test public void Complex() {
@Test public void Complex() {
fx.tst_Doc(String_.Concat
( "{"
, "{"

View File

@@ -27,37 +27,37 @@ public class z152_ndeSubs_data_tst {
, GfmlDocLxrs.Whitespace_lxr()
);
}
@Test public void ToInline() {
@Test public void ToInline() {
fx.tst_Doc("{a;}"
, fx.nde_().Subs_
( fx.nde_().Atru_("a"))
);
}
@Test public void ToInline_many() {
@Test public void ToInline_many() {
fx.tst_Doc("{a b;}"
, fx.nde_().Subs_
( fx.nde_().Atru_("a").Atru_("b"))
);
}
@Test public void ToBody() {
@Test public void ToBody() {
fx.tst_Doc("{a{}}"
, fx.nde_().Subs_
( fx.nde_().Atru_("a"))
);
}
@Test public void ToBody_many() {
@Test public void ToBody_many() {
fx.tst_Doc("{a b{}}"
, fx.nde_().Subs_
( fx.nde_().Atru_("a").Atru_("b"))
);
}
@Test public void ToBody_manyNest() {
@Test public void ToBody_manyNest() {
fx.tst_Doc("a{b;}"
, fx.nde_().Atru_("a").Subs_
( fx.nde_().Atru_("b"))
);
}
@Test public void ToBody_many2() {
@Test public void ToBody_many2() {
fx.tst_Doc("a{b{c;}}"
, fx.nde_().Atru_("a").Subs_
( fx.nde_().Atru_("b").Subs_

View File

@@ -26,19 +26,19 @@ public class z161_ndeHdrs_inline_tst {
, GfmlDocLxrs.Whitespace_lxr()
);
}
@Test public void Basic() {
@Test public void Basic() {
fx.tst_Doc("a:;", fx.nde_().Hnd_("a"));
fx.tst_Tkn("a:;"
, fx.tkn_grp_ary_("a", ":", ";")
);
}
@Test public void Many() {
@Test public void Many() {
fx.tst_Doc("a:;b:;"
, fx.nde_().Hnd_("a")
, fx.nde_().Hnd_("b")
);
}
@Test public void Ws() {
@Test public void Ws() {
fx.tst_Tkn("a : ;"
, fx.tkn_grp_ary_("a", " ", ":", " ", ";")
);

View File

@@ -24,10 +24,10 @@ public class z162_ndeHdrs_err_tst {
( GfmlDocLxrs.NdeHeader_lxr()
);
}
@Test public void NotNamed() {
@Test public void NotNamed() {
fx.tst_Err(":", UsrMsg_mok.new_(GfmlUsrMsgs.fail_DatTkn_notFound()));
}
@Test public void Dangling() {
@Test public void Dangling() {
fx.tst_Err("a{", UsrMsg_mok.new_(GfmlUsrMsgs.fail_Frame_danglingBgn()));
}
}

View File

@@ -26,22 +26,22 @@ public class z163_ndeHdrs_body_tst {
, GfmlDocLxrs.NdeBodyEnd_lxr()
);
}
@Test public void Basic() {
@Test public void Basic() {
fx.tst_Doc("a:{}", fx.nde_().Hnd_("a"));
}
@Test public void Many() {
@Test public void Many() {
fx.tst_Doc("a:{}b:{}"
, fx.nde_().Hnd_("a")
, fx.nde_().Hnd_("b")
);
}
@Test public void Nested() {
@Test public void Nested() {
fx.tst_Doc("a:{b:{}}"
, fx.nde_().Hnd_("a").Subs_
( fx.nde_().Hnd_("b"))
);
}
@Test public void NestedMany() {
@Test public void NestedMany() {
fx.tst_Doc("a:{b:{}c:{}}"
, fx.nde_().Hnd_("a").Subs_
( fx.nde_().Hnd_("b")

View File

@@ -28,7 +28,7 @@ public class z164_hdeHdrs_data_tst {
, GfmlDocLxrs.NdeBodyEnd_lxr()
);
}
@Test public void Bas1() {
@Test public void Bas1() {
fx.tst_Tkn("a:b;"
, fx.tkn_grp_
( fx.tkn_itm_("a")
@@ -37,7 +37,7 @@ public class z164_hdeHdrs_data_tst {
, fx.tkn_itm_(";")
));
}
@Test public void Basic3() {
@Test public void Basic3() {
fx.tst_Tkn("a:b{c;}"
, fx.tkn_grp_
( fx.tkn_itm_("a")

View File

@@ -27,7 +27,7 @@ public class z181_ndeDots_basic_tst {
, GfmlDocLxrs.NdeBodyEnd_lxr()
);
}
@Test public void One() {
@Test public void One() {
fx.tst_Doc("{a.b;c;}"
, fx.nde_().ChainId_(0).Subs_
( fx.nde_().Hnd_("a").ChainId_(1).Subs_
@@ -51,7 +51,7 @@ public class z181_ndeDots_basic_tst {
, fx.tkn_itm_("}")
));
}
@Test public void Many() {
@Test public void Many() {
fx.tst_Doc("{a.b.c.d;e;}"
, fx.nde_().ChainId_(0).Subs_
( fx.nde_().Hnd_("a").ChainId_(1).Subs_

View File

@@ -26,7 +26,7 @@ public class z182_ndeDots_subs_tst {
, GfmlDocLxrs.NdeBodyEnd_lxr()
);
} GfmlParse_fxt fx = GfmlParse_fxt.new_();
@Test public void Basic() {
@Test public void Basic() {
fx.tst_Doc("{a.b{}z;}"
, fx.nde_().ChainId_(0).Subs_
( fx.nde_().Hnd_("a").ChainId_(1).Subs_
@@ -35,7 +35,7 @@ public class z182_ndeDots_subs_tst {
, fx.nde_().Atru_("z").ChainId_(0)
));
}
@Test public void Nest() {
@Test public void Nest() {
fx.ini_RootLxr_Add(GfmlDocLxrs.NdeHeader_lxr());
fx.tst_Doc("{a.b.c{d:e;}z;}" // shorthand of {a{b{c{d:e;}}}}
, fx.nde_().ChainId_(0).Subs_
@@ -49,7 +49,7 @@ public class z182_ndeDots_subs_tst {
, fx.nde_().ChainId_(0).Atru_("z")
));
}
@Test public void Chain() {
@Test public void Chain() {
fx.tst_Doc("{a.b.c;z;}"
, fx.nde_().ChainId_(0).Subs_
( fx.nde_().Hnd_("a").ChainId_(1).Subs_
@@ -59,7 +59,7 @@ public class z182_ndeDots_subs_tst {
, fx.nde_().ChainId_(0).Atru_("z")
));
}
@Test public void NdeHdr() {
@Test public void NdeHdr() {
fx.ini_RootLxr_Add(GfmlDocLxrs.NdeHeader_lxr());
fx.tst_Doc("{a:b.c;z;}"
, fx.nde_().ChainId_(0).Subs_

View File

@@ -28,7 +28,7 @@ public class z183_ndeDots_parens_tst {
, GfmlDocLxrs.NdeHdrEnd_lxr()
);
} GfmlParse_fxt fx = GfmlParse_fxt.new_();
@Test public void Basic() {
@Test public void Basic() {
fx.tst_Doc("{a.b(c);z;}"
, fx.nde_().ChainId_(0).Subs_
( fx.nde_().Hnd_("a").ChainId_(1).Subs_
@@ -37,7 +37,7 @@ public class z183_ndeDots_parens_tst {
, fx.nde_().ChainId_(0).Atru_("z")
));
}
@Test public void Basic_tkn() {
@Test public void Basic_tkn() {
//A_('1');
fx.tst_Tkn("a(c);"
, fx.tkn_grp_
@@ -47,7 +47,7 @@ public class z183_ndeDots_parens_tst {
)
);
}
@Test public void Basic2_tkn() {
@Test public void Basic2_tkn() {
fx.tst_Tkn("a.b(c);"
, fx.tkn_grp_
( fx.tkn_itm_("a"), fx.tkn_itm_(".")
@@ -57,7 +57,7 @@ public class z183_ndeDots_parens_tst {
)
);
}
@Test public void Many() {
@Test public void Many() {
fx.ini_RootLxr_Add(GfmlDocLxrs.Whitespace_lxr());
fx.tst_Doc("{a.b(c d e);z;}"
, fx.nde_().ChainId_(0).Subs_
@@ -67,7 +67,7 @@ public class z183_ndeDots_parens_tst {
, fx.nde_().ChainId_(0).Atru_("z")
));
}
// @Test public void Many2() {
// @Test public void Many2() {
// fx.ini_RootLxr_Add(GfmlDocLxrs.Whitespace_lxr());
// fx.tst_Doc("{a.b(c){d();}}"
// , fx.nde_().ChainId_(0).Subs_
@@ -78,7 +78,7 @@ public class z183_ndeDots_parens_tst {
// )
// ));
// }
@Test public void Chain() {
@Test public void Chain() {
fx.ini_RootLxr_Add(GfmlDocLxrs.Whitespace_lxr());
fx.tst_Doc("{a.b(c).d(e);z;}"
, fx.nde_().ChainId_(0).Subs_
@@ -90,7 +90,7 @@ public class z183_ndeDots_parens_tst {
, fx.nde_().ChainId_(0).Atru_("z")
));
}
@Test public void Nest() {
@Test public void Nest() {
fx.tst_Doc("{a.b(c.d);z;}"
, fx.nde_().ChainId_(0).Subs_
( fx.nde_().Hnd_("a").ChainId_(1).Subs_
@@ -103,7 +103,7 @@ public class z183_ndeDots_parens_tst {
, fx.nde_().Atru_("z")
));
}
@Test public void Nest_longer() {
@Test public void Nest_longer() {
fx.tst_Doc("{a.b.c(d.e.f);z;}"
, fx.nde_().ChainId_(0).Subs_
( fx.nde_().Hnd_("a").ChainId_(1).Subs_
@@ -120,7 +120,7 @@ public class z183_ndeDots_parens_tst {
, fx.nde_().Atru_("z")
));
}
@Test public void Nest_deeper() {
@Test public void Nest_deeper() {
fx.tst_Doc("{a.b(c.d(e.f));z;}"
, fx.nde_().ChainId_(0).Subs_
( fx.nde_().Hnd_("a").ChainId_(1).Subs_

View File

@@ -29,7 +29,7 @@ public class z184_ndeDots_atrSpr_tst {
, GfmlDocLxrs.AtrSpr_lxr()
);
} GfmlParse_fxt fx = GfmlParse_fxt.new_();
@Test public void NestMult() {
@Test public void NestMult() {
fx.ini_RootLxr_Add(GfmlDocLxrs.AtrSpr_lxr());
fx.tst_Doc("{a.b(c.d,e.f);z;}"
, fx.nde_().ChainId_(0).Subs_

View File

@@ -29,20 +29,20 @@ public class z191_ndeProps_basic_tst {
, GfmlDocLxrs.NdeInline_lxr()
);
}
@Test public void Basic() {
@Test public void Basic() {
fx.tst_Doc("a:[b]{}"
, fx.nde_().Hnd_("a").Subs_
( fx.nde_().KeyedSubObj_().Atru_("b"))
);
}
@Test public void Basic_empty() {
@Test public void Basic_empty() {
fx.tst_Tkn("[];"
, fx.tkn_grp_
( fx.tkn_grp_ary_("[", "]")
, fx.tkn_itm_(";")
));
}
@Test public void Hdr() {
@Test public void Hdr() {
fx.tst_Tkn("a[];"
, fx.tkn_grp_
( fx.tkn_grp_ary_("a")
@@ -50,52 +50,52 @@ public class z191_ndeProps_basic_tst {
, fx.tkn_itm_(";")
));
}
@Test public void WithInnerNde() {
@Test public void WithInnerNde() {
fx.tst_Doc("a:[b]{c;}"
, fx.nde_().Hnd_("a").Subs_
( fx.nde_().KeyedSubObj_().Atru_("b")
, fx.nde_().Atru_("c")
));
}
@Test public void DoesNotUsurpDatTknForName() {
@Test public void DoesNotUsurpDatTknForName() {
fx.tst_Doc("a:b[c]{}"
, fx.nde_().Hnd_("a").Atru_("b").Subs_
( fx.nde_().KeyedSubObj_().Atru_("c")
));
}
@Test public void NoHeader_body() {
@Test public void NoHeader_body() {
fx.tst_Doc("a[b]{}"
, fx.nde_().Atru_("a").Subs_
( fx.nde_().KeyedSubObj_().Atru_("b")
));
}
@Test public void NoHeader_inline() {
@Test public void NoHeader_inline() {
fx.tst_Doc("a[b];"
, fx.nde_().Atru_("a").Subs_
( fx.nde_().KeyedSubObj_().Atru_("b")
));
}
@Test public void Nesting() {
@Test public void Nesting() {
fx.tst_Doc("a:[b:;]{}"
, fx.nde_().Hnd_("a").Subs_
( fx.nde_().KeyedSubObj_().Subs_
( fx.nde_().Hnd_("b"))
));
}
@Test public void Nesting2() {
@Test public void Nesting2() {
fx.tst_Doc("a:[b{}]{}"
, fx.nde_().Hnd_("a").Subs_
( fx.nde_().KeyedSubObj_().Atru_("b")
));
}
@Test public void CanBeKeyed_header() {
@Test public void CanBeKeyed_header() {
fx.ini_RootLxr_Add(GfmlDocLxrs.ElmKey_lxr());
fx.tst_Doc("a:b=[c];"
, fx.nde_().Hnd_("a").Subs_
( fx.nde_().KeyedSubObj_().Key_("b").Atru_("c")
));
}
@Test public void CanBeKeyed2_inline() {
@Test public void CanBeKeyed2_inline() {
fx.ini_RootLxr_Add
( GfmlDocLxrs.Whitespace_lxr()
, GfmlDocLxrs.ElmKey_lxr()
@@ -105,12 +105,12 @@ public class z191_ndeProps_basic_tst {
( fx.nde_().KeyedSubObj_().Key_("b").Atru_("c")
));
}
@Test public void Sole() {
@Test public void Sole() {
fx.ini_RootLxr_Add(GfmlDocLxrs.Whitespace_lxr());
fx.tst_Doc("[a b]"
, fx.nde_().KeyedSubObj_().Atru_("a").Atru_("b"));
}
@Test public void Nest1() {
@Test public void Nest1() {
fx.ini_RootLxr_Add(GfmlDocLxrs.Whitespace_lxr());
fx.tst_Doc("[a [b]]"
, fx.nde_().Atru_("a").Subs_

View File

@@ -29,7 +29,7 @@ public class z192_ndeProps_dots_tst {
, GfmlDocLxrs.NdePropEnd_lxr()
);
}
@Test public void Stress() {
@Test public void Stress() {
fx.tst_Doc("a.b[c];"
, fx.nde_().Hnd_("a").Subs_
( fx.nde_().Hnd_("b").Subs_

View File

@@ -21,7 +21,7 @@ public class z452_dflts_exec_tst {
@Before public void setup() {
type = make_("gfml.point", "point", "x");
} GfmlDefaultItem item; GfmlType type; GfmlDefaultItem_fxt fx_item = GfmlDefaultItem_fxt.new_();
@Test public void Basic() {
@Test public void Basic() {
tst_SubFldDefault(type, "x", null);
item = fx_item.make_("gfml.point", "x", "10");
@@ -31,7 +31,7 @@ public class z452_dflts_exec_tst {
item.Exec_end(type);
tst_SubFldDefault(type, "x", null);
}
@Test public void Overwrite() {
@Test public void Overwrite() {
ini_SubFldDefault_add(type, "x", "0");
tst_SubFldDefault(type, "x", "0");
@@ -42,7 +42,7 @@ public class z452_dflts_exec_tst {
item.Exec_end(type);
tst_SubFldDefault(type, "x", "0");
}
@Test public void CreateDefault() {
@Test public void CreateDefault() {
tst_SubFldExists(type, "y", false);
item = fx_item.make_("gfml.point", "y", "10");
@@ -53,7 +53,7 @@ public class z452_dflts_exec_tst {
item.Exec_end(type);
tst_SubFldExists(type, "y", false);
}
@Test public void DefaultTkn() {
@Test public void DefaultTkn() {
Object[] ary = ini_eval_("0");
GfmlTkn varTkn = (GfmlTkn)ary[0];
GfmlVarItm varItem = (GfmlVarItm)ary[1];

View File

@@ -25,7 +25,7 @@ public class z455_dflts_scope_tst {
GfmlType type = makr.MakeRootType("point", "point", "x", "y").DocPos_(rootPos);
regy.Add(type);
} GfmlDocPos rootPos, currPos; GfmlTypRegy regy;
@Test public void Basic() {
@Test public void Basic() {
currPos = rootPos.NewDown(0);
tst_FetchOrNullByPos(regy, "point", rootPos, "point", "x", "y");
tst_FetchOrNullByPos(regy, "point", currPos, "point", "x", "y");

View File

@@ -19,6 +19,6 @@ package gplx.gfml; import gplx.*;
import org.junit.*;
public class z602_edit_nde_tst {
GfmlUpdateFx fx = GfmlUpdateFx.new_();
@Test public void Basic() {
@Test public void Basic() {
}
}

View File

@@ -20,7 +20,7 @@ import org.junit.*;
import gplx.stores.*;
public class z801_useCase_DataRdr_tst {
String raw;
@Test public void Subs_byName() {
@Test public void Subs_byName() {
raw = String_.Concat
( "_type:{"
, " item {"
@@ -39,7 +39,7 @@ public class z801_useCase_DataRdr_tst {
subRdr = rdr.Subs_byName_moveFirst("point");
fx_rdr.tst_Atrs(subRdr, kv_("x", "1"), kv_("y", "2"));
}
// @Test
// @Test
public void Subs_byName3() {
raw = String_.Concat
( "_type:{"

View File

@@ -18,13 +18,13 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
package gplx.gfml; import gplx.*;
import org.junit.*;
public class z811_useCase_GfmlIoSql_tst {
@Test public void Basic() {
@Test public void Basic() {
tst_Doc("fld1=val1", nde_("fld").Atrs_add_("word", "fld1").Atrs_add_("op", "=").Atrs_add_("word", "val1"));
tst_Doc("fld1 = val1", nde_("fld").Atrs_add_("word", "fld1").Atrs_add_("op", "=").Atrs_add_("word", "val1"));
tst_Doc("fld1='val1'", nde_("fld").Atrs_add_("word", "fld1").Atrs_add_("op", "=").Atrs_add_("word", "val1"));
tst_Doc("fld1='val 1'", nde_("fld").Atrs_add_("word", "fld1").Atrs_add_("op", "=").Atrs_add_("word", "val 1"));
}
@Test public void Basic2() {
@Test public void Basic2() {
tst_Doc("1=1 OR 2=2", nde_("fld").Atrs_add_("word", "1").Atrs_add_("op", "=").Atrs_add_("word", "1")
.Atrs_add_("word", "OR")
.Atrs_add_("word", "2").Atrs_add_("op", "=").Atrs_add_("word", "2")