summaryrefslogtreecommitdiff
path: root/tests/run.lua
diff options
context:
space:
mode:
Diffstat (limited to 'tests/run.lua')
-rw-r--r--tests/run.lua17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/run.lua b/tests/run.lua
index 19568fa..d88de73 100644
--- a/tests/run.lua
+++ b/tests/run.lua
@@ -4007,6 +4007,23 @@ test("Relative lower-case keys use the stored descriptor", function()
end
end)
+test("Relative upper-case keys swap the stored descriptor", function()
+ fresh_sequence_state()
+ local host = MemoryHost.new({
+ configuration = { fix_key_direction = false },
+ })
+ local resolver = repeat_resolver.new({ policy = policy.new(host) })
+
+ for _, stored in ipairs({ "f", "F", "t", "T" }) do
+ for _, pressed in ipairs({ "F", "T" }) do
+ local expected = domain.Descriptor.swap(stored)
+ local actual = resolver:resolve_primary_direction(stored, pressed)
+ same(expected, actual, stored .. "/" .. pressed)
+ same(domain.Descriptor.from_string(stored).family, actual.family)
+ end
+ end
+end)
+
for _, item in ipairs(tests) do
local ok, failure = xpcall(item.body, debug.traceback)
if not ok then