From f697ea7e7603e916d5ee13327fcdaf9c811a00aa Mon Sep 17 00:00:00 2001 From: Thijs Schreijer Date: Sun, 26 Jan 2025 20:15:39 +0100 Subject: feat(terminal): check ambiguous unicode width --- spec/04-term_spec.lua | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'spec') diff --git a/spec/04-term_spec.lua b/spec/04-term_spec.lua index 813947a..711059b 100644 --- a/spec/04-term_spec.lua +++ b/spec/04-term_spec.lua @@ -539,6 +539,12 @@ describe("Terminal:", function() assert.same({2}, {system.utf8cwidth(ch2 .. ch3 .. ch4)}) end) + it("returns 2nd ambigious boolean value only if requested", function() + assert.same({1}, {system.utf8cwidth("¡", false)}) + assert.same({1, true}, {system.utf8cwidth("¡", true)}) + assert.same({1, false}, {system.utf8cwidth("a", true)}) + end) + end) -- cgit v1.2.3-55-g6feb