diff options
| author | Jackson Moore <jacksonmoore@tuta.io> | 2026-09-04 11:54:05 +0200 |
|---|---|---|
| committer | Jackson Moore <jacksonmoore@tuta.io> | 2026-09-04 11:54:05 +0200 |
| commit | 08bdcf5239e4d69cb08933a0b079ca18e151c3ae (patch) | |
| tree | 87aadeb89e23ba1808f6a13d69cd85c35a07a464 /tests | |
| parent | 71c815b9794f19df9451f59fac6dd0368d91e1f8 (diff) | |
Fix special key packet bytes
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/run.lua | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/run.lua b/tests/run.lua index 31c223e..61ab1ab 100644 --- a/tests/run.lua +++ b/tests/run.lua @@ -253,11 +253,20 @@ test("InputPacket carries every input capability variant", function() local text = domain.InputPacket.text("a") local bytes = domain.InputPacket.raw_bytes({ 0x80, 0xfd, 0x60 }) local special = domain.InputPacket.special_key("Left", string.char(0x80, 1)) + local special_from_table = domain.InputPacket.from_table({ + kind = "special_key", + name = "Escape", + bytes = { 27 }, + }) local failure = domain.InputPacket.error("input failed") same(domain.InputPacketKind.TEXT, text.kind) list_same({ 0x80, 0xfd, 0x60 }, bytes:bytes()) same("Left", special.name) + list_same({ 0x80, 1 }, special:bytes()) + same(string.char(27), special_from_table.encoded) + list_same({ 27 }, special_from_table:bytes()) + list_same({ 27 }, special_from_table:to_table().bytes) same("input failed", failure.message) end) |
