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

@@ -21,7 +21,7 @@ public class EnmParser_tst {
@Before public void setup() {
parser = EnmMgr.new_();
}
@Test public void Basic() { // 1,2,4,8
@Test public void Basic() { // 1,2,4,8
parser.BitRngEnd_(8);
run_Reg(0, "zero");
run_Reg(1, "one");
@@ -34,7 +34,7 @@ public class EnmParser_tst {
tst_Convert("eight", 8);
tst_Convert("one+eight", 9);
}
@Test public void Keys() {
@Test public void Keys() {
parser.BitRngBgn_(65536).BitRngEnd_(262144);
run_Reg( 65, "a");
run_Reg( 65536, "shift");
@@ -45,7 +45,7 @@ public class EnmParser_tst {
tst_Convert("ctrl+a", 65 + 131072);
tst_Convert("shift+ctrl+a", 65 + 65536 + 131072);
}
@Test public void Prefix() {
@Test public void Prefix() {
parser.Prefix_("key.").BitRngBgn_(128).BitRngEnd_(128);
run_Reg(65, "a");
tst_Convert("key.a", 65);

View File

@@ -22,31 +22,31 @@ public class GfoMsg_rdr_tst {
msg = msg_().Add("a", "1").Add("b", "2").Add("c", "3");
ctx.Match("init", "init");
} GfoMsg msg; GfsCtx ctx = GfsCtx.new_();
@Test public void Key() {
@Test public void Key() {
tst_Msg(msg, "a", "1");
tst_Msg(msg, "b", "2");
tst_Msg(msg, "c", "3");
tst_Msg(msg, "d", null);
}
@Test public void Pos() {
@Test public void Pos() {
msg = msg_().Add("", "1").Add("", "2").Add("", "3");
tst_Msg(msg, "", "1");
tst_Msg(msg, "", "2");
tst_Msg(msg, "", "3");
tst_Msg(msg, "", null);
}
@Test public void OutOfOrder() {
@Test public void OutOfOrder() {
tst_Msg(msg, "c", "3");
tst_Msg(msg, "b", "2");
tst_Msg(msg, "a", "1");
}
@Test public void Key3_Pos1_Pos2() {
@Test public void Key3_Pos1_Pos2() {
msg = msg_().Add("", "1").Add("", "2").Add("c", "3");
tst_Msg(msg, "c", "3");
tst_Msg(msg, "", "1");
tst_Msg(msg, "", "2");
}
@Test public void MultipleEmpty() {
@Test public void MultipleEmpty() {
msg = msg_().Add("", "1").Add("", "2").Add("", "3");
tst_Msg(msg, "", "1");
tst_Msg(msg, "", "2");

View File

@@ -22,7 +22,7 @@ public class IoEngine_dir_basic_system_tst extends IoEngine_dir_basic_base {
root = Tfds.RscDir.GenSubDir_nest("100_core", "ioEngineTest", "_temp");
IoEngine_xrg_deleteDir.new_(root).Recur_().ReadOnlyFails_off().Exec();
} @Override protected IoEngine engine_() {return IoEngine_system.new_();}
@Test @Override public void ScanDir() {
@Test @Override public void ScanDir() {
super.ScanDir();
}
}

View File

@@ -23,13 +23,13 @@ public class IoEngine_fil_basic_system_tst extends IoEngine_fil_basic_base {
fil = root.GenSubFil("fil.txt");
IoEngine_xrg_deleteDir.new_(fil.OwnerDir()).Recur_().ReadOnlyFails_off().Exec();
} @Override protected IoEngine engine_() {return IoEngine_system.new_();}
@Test public void ExistsFil_IgnoreDifferentCasing() {
@Test public void ExistsFil_IgnoreDifferentCasing() {
if (root.Info().CaseSensitive()) return;
fx.run_SaveFilText(fil, "text");
fx.tst_ExistsPaths(true, fil);
fx.tst_ExistsPaths(true, fil.OwnerDir().GenSubFil("FIL.txt"));
}
@Test @gplx.Virtual public void RecycleFil() {
@Test @gplx.Virtual public void RecycleFil() {
fx.run_SaveFilText(fil, "text");
fx.tst_ExistsPaths(true, fil);
@@ -46,13 +46,13 @@ public class IoEngine_fil_basic_system_tst extends IoEngine_fil_basic_base {
fx.tst_ExistsPaths(true, fil);
fx.tst_ExistsPaths(false, recycleXrg.RecycleUrl());
}
@Test @Override public void DeleteFil_missing_pass() {
@Test @Override public void DeleteFil_missing_pass() {
super.DeleteFil_missing_pass();
}
@Test @Override public void DeleteFil_readOnly_pass() {
@Test @Override public void DeleteFil_readOnly_pass() {
super.DeleteFil_readOnly_pass ();
}
@Test @Override public void SaveFilText_readOnlyFails() {
@Test @Override public void SaveFilText_readOnlyFails() {
super.SaveFilText_readOnlyFails();
}
}

View File

@@ -18,23 +18,23 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
package gplx.stores; import gplx.*;
import org.junit.*;
public class GfoNdeRdr_read_tst {
@Test public void ReadInt() {
@Test public void ReadInt() {
rdr = rdr_(IntClassXtn._, "id", 1);
Tfds.Eq(rdr.ReadInt("id"), 1);
}
@Test public void ReadIntOr() {
@Test public void ReadIntOr() {
rdr = rdr_(IntClassXtn._, "id", 1);
Tfds.Eq(rdr.ReadIntOr("id", -1), 1);
}
@Test public void ReadIntElse_minus1() {
@Test public void ReadIntElse_minus1() {
rdr = rdr_(IntClassXtn._, "id", null);
Tfds.Eq(rdr.ReadIntOr("id", -1), -1);
}
@Test public void ReadInt_parse() {
@Test public void ReadInt_parse() {
rdr = rdr_(StringClassXtn._, "id", "1");
Tfds.Eq(rdr.ReadInt("id"), 1);
}
@Test public void ReadIntElse_parse() {
@Test public void ReadIntElse_parse() {
rdr = rdr_(StringClassXtn._, "id", "2");
Tfds.Eq(rdr.ReadIntOr("id", -1), 2);
}

View File

@@ -18,14 +18,14 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
package gplx.stores.xmls; import gplx.*; import gplx.stores.*;
import org.junit.*;
public class XmlDataRdr_tst {
@Test public void Read() {
@Test public void Read() {
DataRdr rdr = fx.rdr_("<title id=\"1\" name=\"first\" profiled=\"false\" />");
Tfds.Eq(rdr.NameOfNode(), "title");
Tfds.Eq(rdr.ReadStr("name"), "first");
Tfds.Eq(rdr.ReadInt("id"), 1);
Tfds.Eq(rdr.ReadBool("profiled"), false);
}
@Test public void None() {
@Test public void None() {
DataRdr rdr = fx.rdr_
( "<root>"
, "<find/>"
@@ -33,7 +33,7 @@ public class XmlDataRdr_tst {
);
fx.tst_Subs_ByName(rdr, "no_nde", "no_atr");
}
@Test public void One() {
@Test public void One() {
DataRdr rdr = fx.rdr_
( "<root>"
, "<find id=\"f0\" />"
@@ -41,7 +41,7 @@ public class XmlDataRdr_tst {
);
fx.tst_Subs_ByName(rdr, "find", "id", "f0");
}
@Test public void One_IgnoreOthers() {
@Test public void One_IgnoreOthers() {
DataRdr rdr = fx.rdr_
( "<root>"
, "<find id=\"f0\" />"
@@ -50,7 +50,7 @@ public class XmlDataRdr_tst {
);
fx.tst_Subs_ByName(rdr, "find", "id", "f0");
}
@Test public void Many() {
@Test public void Many() {
DataRdr rdr = fx.rdr_
( "<root>"
, "<find id=\"f0\" />"
@@ -59,7 +59,7 @@ public class XmlDataRdr_tst {
);
fx.tst_Subs_ByName(rdr, "find", "id", "f0", "f1");
}
@Test public void Nested() {
@Test public void Nested() {
DataRdr rdr = fx.rdr_
( "<root>"
, "<sub1>"
@@ -70,7 +70,7 @@ public class XmlDataRdr_tst {
);
fx.tst_Subs_ByName(rdr, "sub1/find", "id", "f0", "f1");
}
@Test public void Nested_IgnoreOthers() {
@Test public void Nested_IgnoreOthers() {
DataRdr rdr = fx.rdr_
( "<root>"
, "<sub1>"