abouttreesummaryrefslogcommitdiff
path: root/test/juloo.keyboard2/KeyValueParserTest.java
diff options
context:
space:
mode:
authorJules Aguillon2025-02-28 00:17:28 +0100
committerJules Aguillon2025-02-28 00:17:28 +0100
commitb7d1508d7b74b3d634b8f3a547d56c27e10f80c8 (patch)
tree80bebb1fbdba221fecd6ed1aca22f94cedea57bc /test/juloo.keyboard2/KeyValueParserTest.java
parent77b0c307289dad46c15021890217a7859b775d53 (diff)
downloadunexpected-keyboard-b7d1508d7b74b3d634b8f3a547d56c27e10f80c8.tar.gz
unexpected-keyboard-b7d1508d7b74b3d634b8f3a547d56c27e10f80c8.zip
Refactor: Remove StringWithSymbol
It's replaced with a macro containing one key.
Diffstat (limited to 'test/juloo.keyboard2/KeyValueParserTest.java')
-rw-r--r--test/juloo.keyboard2/KeyValueParserTest.java9
1 files changed, 4 insertions, 5 deletions
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