mirror of
https://github.com/gnosygnu/xowa.git
synced 2026-03-02 03:49:30 +00:00
v1.8.1.1
This commit is contained in:
@@ -24,16 +24,16 @@ public class IptCfg_tst {
|
||||
cfg = new IptCfg_mok();
|
||||
key = IptBndsOwner_mok.Invk_Reg;
|
||||
} IptBndsOwner_mok box; IptCfg_mok cfg; String key;
|
||||
@Test public void Basic() {
|
||||
@Test public void Basic() {
|
||||
cfg.run_GetOrDflt(box, key, IptKey_.A);
|
||||
box.tst_SendKey(IptKey_.A, 1);
|
||||
}
|
||||
@Test public void Del() {
|
||||
@Test public void Del() {
|
||||
cfg.run_GetOrDflt(box, key, IptKey_.A);
|
||||
box.IptBnds().Cfgs_delAll();
|
||||
box.tst_SendKey(IptKey_.A, 0);
|
||||
}
|
||||
@Test public void Change() {
|
||||
@Test public void Change() {
|
||||
cfg.run_GetOrDflt(box, key, IptKey_.A);
|
||||
cfg.run_Set(key, IptKey_.B);
|
||||
box.tst_SendKey(IptKey_.B, 1);
|
||||
@@ -42,19 +42,19 @@ public class IptCfg_tst {
|
||||
box.tst_SendKey(IptKey_.C, 1);
|
||||
box.tst_SendKey(IptKey_.B, 0);
|
||||
}
|
||||
@Test public void SetBeforeInit() {
|
||||
@Test public void SetBeforeInit() {
|
||||
cfg.run_Set(key, IptKey_.B);
|
||||
cfg.run_GetOrDflt(box, key, IptKey_.A);
|
||||
box.tst_SendKey(IptKey_.B, 1);
|
||||
box.tst_SendKey(IptKey_.A, 0);
|
||||
}
|
||||
@Test public void SetBeforeInit_msg() {
|
||||
@Test public void SetBeforeInit_msg() {
|
||||
cfg.run_Set_msg(key, 2, IptKey_.B);
|
||||
cfg.run_GetOrDflt(box, key, IptKey_.A); // iptBnd exists; ignore Key_.A (and also msg=1)
|
||||
box.tst_SendKey(IptKey_.B, 2);
|
||||
box.tst_SendKey(IptKey_.A, 0);
|
||||
}
|
||||
@Test public void Chained() {
|
||||
@Test public void Chained() {
|
||||
cfg.run_GetOrDflt(box, key, IptKeyChain.parse_("key.ctrl+key.a,key.b"));
|
||||
cfg.run_Set(key, IptKey_.A);
|
||||
box.tst_SendKey(IptKey_.A, 1);
|
||||
|
||||
@@ -18,7 +18,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
package gplx.gfui; import gplx.*;
|
||||
import org.junit.*;
|
||||
public class ClipboardAdp__tst {
|
||||
@Test public void Basic() {
|
||||
@Test public void Basic() {
|
||||
ClipboardAdp_.SetText("test");
|
||||
Tfds.Eq(true, ClipboardAdp_.IsText());
|
||||
Tfds.Eq("test", ClipboardAdp_.GetText());
|
||||
|
||||
@@ -21,20 +21,20 @@ public class GfuiBorderMgr_tst {
|
||||
@Before public void setup() {
|
||||
borderMgr = GfuiBorderMgr.new_();
|
||||
}
|
||||
@Test public void NullToEdge() { // all null -> one edge
|
||||
@Test public void NullToEdge() { // all null -> one edge
|
||||
tst_Eq(borderMgr, null, null, null, null, null);
|
||||
|
||||
borderMgr.Top_(red);
|
||||
tst_Eq(borderMgr, null, red, null, null, null);
|
||||
}
|
||||
@Test public void EdgeToAll() { // one edge -> all edge
|
||||
@Test public void EdgeToAll() { // one edge -> all edge
|
||||
borderMgr.Top_(red);
|
||||
tst_Eq(borderMgr, null, red, null, null, null);
|
||||
|
||||
borderMgr.All_(black);
|
||||
tst_Eq(borderMgr, black, null, null, null, null);
|
||||
}
|
||||
@Test public void AllToEdge() { // all edge -> one new; three old
|
||||
@Test public void AllToEdge() { // all edge -> one new; three old
|
||||
borderMgr.All_(red);
|
||||
tst_Eq(borderMgr, red, null, null, null, null);
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
package gplx.gfui; import gplx.*;
|
||||
import org.junit.*;
|
||||
public class GfuiClickKeyMgr_tst {
|
||||
@Test public void ExtractKeyFromText() {
|
||||
@Test public void ExtractKeyFromText() {
|
||||
tst_ExtractKey("&click", IptKey_.C);
|
||||
tst_ExtractKey("&", IptKey_.None);
|
||||
tst_ExtractKey("trailing &", IptKey_.None);
|
||||
|
||||
@@ -22,28 +22,28 @@ public class GfuiFocusOrderer_tst {
|
||||
owner = GfuiElem_.new_();
|
||||
list = ListAdp_.new_(); // list of all controls
|
||||
}
|
||||
@Test public void Horizontal() {
|
||||
@Test public void Horizontal() {
|
||||
ini_Subs(owner, list, xy_(40, 0), xy_(20, 0), xy_(0, 0));
|
||||
tst_FocusIndxs(owner, list, 0, 1, 2);
|
||||
|
||||
GfuiFocusOrderer.OrderByX(owner);
|
||||
tst_FocusIndxs(owner, list, 2, 1, 0);
|
||||
}
|
||||
@Test public void Vertical() {
|
||||
@Test public void Vertical() {
|
||||
ini_Subs(owner, list, xy_(0, 40), xy_(0, 20), xy_(0, 0));
|
||||
tst_FocusIndxs(owner, list, 0, 1, 2);
|
||||
|
||||
GfuiFocusOrderer.OrderByY(owner);
|
||||
tst_FocusIndxs(owner, list, 2, 1, 0);
|
||||
}
|
||||
@Test public void Grid() {
|
||||
@Test public void Grid() {
|
||||
ini_Subs(owner, list, xy_(20, 20), xy_(0, 20), xy_(20, 0), xy_(0, 0));
|
||||
tst_FocusIndxs(owner, list, 0, 1, 2, 3);
|
||||
|
||||
GfuiFocusOrderer.OrderByX(owner);
|
||||
tst_FocusIndxs(owner, list, 3, 2, 1, 0);
|
||||
}
|
||||
@Test public void Deep() {
|
||||
@Test public void Deep() {
|
||||
ini_Subs(owner, list, xy_(20, 0), xy_(0, 0));
|
||||
GfuiElem sub0 = sub_(owner, 0), sub1 = sub_(owner, 1);
|
||||
ini_Subs(sub0, list, xy_(20, 0), xy_(0, 0));
|
||||
@@ -53,7 +53,7 @@ public class GfuiFocusOrderer_tst {
|
||||
GfuiFocusOrderer.OrderByX(owner);
|
||||
tst_FocusIndxs(owner, list, 3, 0, 5, 4, 2, 1);
|
||||
}
|
||||
@Test public void Manusl() {
|
||||
@Test public void Manusl() {
|
||||
ini_Subs(owner, list, xy_(0, 0), xy_(20, 0));
|
||||
tst_FocusIndxs(owner, list, 0, 1);
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ public class GfuiMoveElemBtn_tst {
|
||||
GfuiMoveElemBnd bnd = GfuiMoveElemBnd.new_(); bnd.TargetElem_set(form);
|
||||
moveBtn.IptBnds().Add(bnd);
|
||||
}
|
||||
@Test public void Basic() {
|
||||
@Test public void Basic() {
|
||||
Tfds.Eq(form.X(), 0);
|
||||
IptEventMgr.ExecKeyDown(moveBtn, IptEvtDataKey.test_(MoveRightArg()));
|
||||
Tfds.Eq(form.X(), 10);
|
||||
|
||||
@@ -18,7 +18,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
package gplx.gfui; import gplx.*;
|
||||
import org.junit.*;
|
||||
public class IptArg_parser_tst {
|
||||
@Test public void KeyBasic() {
|
||||
@Test public void KeyBasic() {
|
||||
tst_parse_Key_("key.a", IptKey_.A);
|
||||
tst_parse_Key_("key.d0", IptKey_.D0);
|
||||
tst_parse_Key_("key.semicolon", IptKey_.Semicolon);
|
||||
@@ -27,34 +27,34 @@ public class IptArg_parser_tst {
|
||||
tst_parse_Key_("key.ctrl", IptKey_.Ctrl);
|
||||
tst_parse_Key_("key.none", IptKey_.None);
|
||||
} void tst_parse_Key_(String raw, IptKey expd) {Tfds.Eq(expd.Val(), IptKey_.parse_(raw).Val());}
|
||||
@Test public void KbdCmdModifiers() {
|
||||
@Test public void KbdCmdModifiers() {
|
||||
tst_parse_Key_("key.ctrl+key.enter", IptKey_.Ctrl.Add(IptKey_.Enter));
|
||||
tst_parse_Key_("key.alt+key.escape", IptKey_.Alt.Add(IptKey_.Escape));
|
||||
tst_parse_Key_("key.shift+key.f1", IptKey_.Shift.Add(IptKey_.F1));
|
||||
tst_parse_Key_("key.shift+key.ctrl", IptKey_.Ctrl.Add(IptKey_.Shift));
|
||||
tst_parse_Key_("key.ctrl+key.alt+key.slash", IptKey_.Ctrl.Add(IptKey_.Alt).Add(IptKey_.Slash));
|
||||
}
|
||||
@Test public void KeyWhitespace() {
|
||||
@Test public void KeyWhitespace() {
|
||||
tst_parse_Key_("key.ctrl + key.alt + key.slash", IptKey_.Ctrl.Add(IptKey_.Alt).Add(IptKey_.Slash));
|
||||
}
|
||||
@Test public void MouseBtn() {
|
||||
@Test public void MouseBtn() {
|
||||
tst_parse_MouseBtn_("mouse.left", IptMouseBtn_.Left);
|
||||
tst_parse_MouseBtn_("mouse.right", IptMouseBtn_.Right);
|
||||
tst_parse_MouseBtn_("mouse.middle", IptMouseBtn_.Middle);
|
||||
tst_parse_MouseBtn_("mouse.x1", IptMouseBtn_.X1);
|
||||
tst_parse_MouseBtn_("mouse.x2", IptMouseBtn_.X2);
|
||||
} void tst_parse_MouseBtn_(String raw, IptMouseBtn expd) {Tfds.Eq(expd, IptMouseBtn_.parse_(raw));}
|
||||
@Test public void MouseWheel() {
|
||||
@Test public void MouseWheel() {
|
||||
tst_parse_MouseWheel_("wheel.up", IptMouseWheel_.Up);
|
||||
tst_parse_MouseWheel_("wheel.down", IptMouseWheel_.Down);
|
||||
} void tst_parse_MouseWheel_(String raw, IptMouseWheel expd) {Tfds.Eq(expd, IptMouseWheel_.parse_(raw));}
|
||||
@Test public void Mod() {
|
||||
@Test public void Mod() {
|
||||
tst_parse_("mod.c", IptKey_.Ctrl);
|
||||
tst_parse_("mod.cs", IptKey_.add_(IptKey_.Ctrl, IptKey_.Shift));
|
||||
tst_parse_("mod.cas", IptKey_.add_(IptKey_.Ctrl, IptKey_.Alt, IptKey_.Shift));
|
||||
tst_parse_("mod.c+key.c", IptKey_.add_(IptKey_.Ctrl, IptKey_.C));
|
||||
}
|
||||
@Test public void All() {
|
||||
@Test public void All() {
|
||||
tst_parse_("key.c", IptKey_.C);
|
||||
tst_parse_("mouse.left", IptMouseBtn_.Left);
|
||||
tst_parse_("wheel.up", IptMouseWheel_.Up);
|
||||
|
||||
@@ -18,7 +18,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
package gplx.gfui; import gplx.*;
|
||||
import org.junit.*;
|
||||
public class IptEventType_tst {
|
||||
@Test public void Has() {
|
||||
@Test public void Has() {
|
||||
tst_Has(IptEventType_.KeyDown, IptEventType_.KeyDown, true);
|
||||
tst_Has(IptEventType_.KeyUp, IptEventType_.KeyDown, false);
|
||||
tst_Has(IptEventType_.None, IptEventType_.KeyDown, false);
|
||||
@@ -27,7 +27,7 @@ public class IptEventType_tst {
|
||||
tst_Has(IptEventType_.MouseDown.Add(IptEventType_.MouseUp), IptEventType_.KeyDown, false);
|
||||
tst_Has(IptEventType_.KeyDown.Add(IptEventType_.KeyUp), IptEventType_.None, false);
|
||||
} void tst_Has(IptEventType val, IptEventType find, boolean expd) {Tfds.Eq(expd, IptEventType_.Has(val, find));}
|
||||
@Test public void add_() {
|
||||
@Test public void add_() {
|
||||
tst_add(IptEventType_.KeyDown, IptEventType_.KeyDown, IptEventType_.KeyDown.Val());
|
||||
tst_add(IptEventType_.KeyDown, IptEventType_.KeyUp, IptEventType_.KeyDown.Val() + IptEventType_.KeyUp.Val());
|
||||
} void tst_add(IptEventType lhs, IptEventType rhs, int expd) {Tfds.Eq(expd, IptEventType_.add_(lhs, rhs).Val());}
|
||||
|
||||
@@ -18,11 +18,11 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
package gplx.gfui; import gplx.*;
|
||||
import org.junit.*;
|
||||
public class ScreenAdp_tst {
|
||||
@Test public void parse_() {
|
||||
@Test public void parse_() {
|
||||
ScreenAdp actl = ScreenAdp_.parse_("{screen{0}");
|
||||
Tfds.Eq(0, actl.Index());
|
||||
}
|
||||
@Test public void opposite_() {
|
||||
@Test public void opposite_() {
|
||||
ScreenAdp actl = ScreenAdp_.from_point_(PointAdp_.new_(2000, 2000));
|
||||
Tfds.Eq(0, actl.Index());
|
||||
}
|
||||
|
||||
@@ -21,11 +21,11 @@ public class TabBox_tst {
|
||||
// @Before public void setup() {
|
||||
// fx = TabBoxFxt.new_();
|
||||
// } TabBoxFxt fx;
|
||||
@Test public void Add() {
|
||||
@Test public void Add() {
|
||||
// fx.Make(1).tst_Selected("0").FetchBtnAt(0).tst_X(0);
|
||||
// fx.Make(3).tst_Selected("2").FetchBtnAt(2).tst_X(160);
|
||||
}
|
||||
// @Test public void DelAt() {
|
||||
// @Test public void DelAt() {
|
||||
// fx.Make(2).DelAt(1).tst_Btns("0");
|
||||
// fx.Make(2).DelAt(0).tst_Btns("1");
|
||||
// fx.Make(3).DelAt(0).tst_Btns("1", "2");
|
||||
@@ -36,17 +36,17 @@ public class TabBox_tst {
|
||||
// fx.Make(3).Select(1).DelAt(0).tst_Selected("1"); // 0 deleted; 1 still remains active (but will have idx of 0
|
||||
// fx.Make(3).Select(2).DelAt(2).tst_Selected("1"); // 2 deleted; 1 selected
|
||||
// }
|
||||
// @Test public void Selected_byAdd() {
|
||||
// @Test public void Selected_byAdd() {
|
||||
// fx.Make(2).Select(0).tst_Selected("0").Select(1).tst_Selected("1");
|
||||
// }
|
||||
// @Test public void Selected_byBtn() {
|
||||
// @Test public void Selected_byBtn() {
|
||||
// fx.Make(2).tst_Selected("1");
|
||||
//
|
||||
// GfuiBtn btn = fx.TabBox().SubBtnArea().FetchAt(0);
|
||||
// btn.Click();
|
||||
// fx.tst_Selected("0");
|
||||
// }
|
||||
// @Test public void ReorderTab() {
|
||||
// @Test public void ReorderTab() {
|
||||
// fx.Make(3).Reorder(0, -1).tst_Raised(false);
|
||||
// fx.Make(3).Reorder(2, 1).tst_Raised(false);
|
||||
// fx.Make(3).Reorder(0, 1).tst_Btns("1", "0", "2").tst_Raised(true).tst_FocusOrder();
|
||||
|
||||
Reference in New Issue
Block a user