diff options
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) |
