From b7d1508d7b74b3d634b8f3a547d56c27e10f80c8 Mon Sep 17 00:00:00 2001 From: Jules Aguillon Date: Fri, 28 Feb 2025 00:17:28 +0100 Subject: Refactor: Remove StringWithSymbol It's replaced with a macro containing one key. --- test/juloo.keyboard2/KeyValueParserTest.java | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'test/juloo.keyboard2/KeyValueParserTest.java') diff --git a/test/juloo.keyboard2/KeyValueParserTest.java b/test/juloo.keyboard2/KeyValueParserTest.java index 7ece1a7..b7abbef 100644 --- a/test/juloo.keyboard2/KeyValueParserTest.java +++ b/test/juloo.keyboard2/KeyValueParserTest.java @@ -26,9 +26,6 @@ public class KeyValueParserTest @Test public void parse_macro() throws Exception { - Utils.parse("symbol:abc", KeyValue.makeMacro("symbol", new KeyValue[]{ - KeyValue.makeStringKey("abc") - }, 0)); Utils.parse("copy:ctrl,a,ctrl,c", KeyValue.makeMacro("copy", new KeyValue[]{ KeyValue.getSpecialKeyByName("ctrl"), KeyValue.makeStringKey("a"), @@ -59,6 +56,7 @@ public class KeyValueParserTest public void parse_non_macro() throws Exception { Utils.parse("a:b", KeyValue.makeCharKey('b', "a", 0)); + Utils.parse("symbol:abc", KeyValue.makeStringKey("abc").withSymbol("symbol")); } @Test @@ -94,6 +92,7 @@ public class KeyValueParserTest @Test public void parse_key_event() throws Exception { + Utils.parse("a:keyevent:85", KeyValue.keyeventKey("a", 85, 0)); Utils.parse("symbol:keyevent:85", KeyValue.keyeventKey("symbol", 85, 0)); Utils.parse("macro:keyevent:85,abc", KeyValue.makeMacro("macro", new KeyValue[]{ KeyValue.keyeventKey("", 85, 0), @@ -112,8 +111,8 @@ public class KeyValueParserTest { Utils.parse(":str:'Foo'", KeyValue.makeStringKey("Foo")); Utils.parse(":str flags='dim':'Foo'", KeyValue.makeStringKey("Foo", KeyValue.FLAG_SECONDARY)); - Utils.parse(":str symbol='Symbol':'Foo'", KeyValue.makeStringKeyWithSymbol("Foo", "Symbol", 0)); - Utils.parse(":str symbol='Symbol' flags='dim':'Foo'", KeyValue.makeStringKeyWithSymbol("Foo", "Symbol", KeyValue.FLAG_SECONDARY)); + Utils.parse(":str symbol='Symbol':'Foo'", KeyValue.makeStringKey("Foo").withSymbol("Symbol")); + Utils.parse(":str symbol='Symbol' flags='dim':'f'", KeyValue.makeStringKey("f").withSymbol("Symbol").withFlags(KeyValue.FLAG_SECONDARY)); Utils.parse(":str flags='dim,small':'Foo'", KeyValue.makeStringKey("Foo", KeyValue.FLAG_SECONDARY | KeyValue.FLAG_SMALLER_FONT)); Utils.parse(":str flags=',,':'Foo'", KeyValue.makeStringKey("Foo")); // Unintentional Utils.expect_error(":unknown:Foo"); // Unknown kind -- cgit v1.2.3