diff options
Diffstat (limited to 'spec/04-term_spec.lua')
-rw-r--r-- | spec/04-term_spec.lua | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/spec/04-term_spec.lua b/spec/04-term_spec.lua index 0ce0033..5dea046 100644 --- a/spec/04-term_spec.lua +++ b/spec/04-term_spec.lua | |||
@@ -902,6 +902,14 @@ describe("Terminal:", function() | |||
902 | end) | 902 | end) |
903 | 903 | ||
904 | 904 | ||
905 | it("reads a control byte for single-byte control characters", function() | ||
906 | setbuffer("\000\031\127") | ||
907 | assert.are.same({"\000", "ctrl"}, {system.readansi(0)}) | ||
908 | assert.are.same({"\031", "ctrl"}, {system.readansi(0)}) | ||
909 | assert.are.same({"\127", "ctrl"}, {system.readansi(0)}) | ||
910 | end) | ||
911 | |||
912 | |||
905 | it("reads a multi-byte characters one at a time", function() | 913 | it("reads a multi-byte characters one at a time", function() |
906 | setbuffer(string.char(226, 130, 172) .. -- "€" single | 914 | setbuffer(string.char(226, 130, 172) .. -- "€" single |
907 | string.char(240, 159, 154, 128)) -- "🚀" double | 915 | string.char(240, 159, 154, 128)) -- "🚀" double |
@@ -952,7 +960,7 @@ describe("Terminal:", function() | |||
952 | 960 | ||
953 | it("returns a single <esc> character if no sequence is found", function() | 961 | it("returns a single <esc> character if no sequence is found", function() |
954 | setbuffer("\27") | 962 | setbuffer("\27") |
955 | assert.are.same({"\27", "char"}, {system.readansi(0)}) | 963 | assert.are.same({"\27", "ctrl"}, {system.readansi(0)}) |
956 | end) | 964 | end) |
957 | 965 | ||
958 | 966 | ||