summaryrefslogtreecommitdiff
path: root/lib/std/test/chartype.myr
diff options
context:
space:
mode:
Diffstat (limited to 'lib/std/test/chartype.myr')
-rw-r--r--lib/std/test/chartype.myr18
1 files changed, 18 insertions, 0 deletions
diff --git a/lib/std/test/chartype.myr b/lib/std/test/chartype.myr
index d0df1d2..30426e6 100644
--- a/lib/std/test/chartype.myr
+++ b/lib/std/test/chartype.myr
@@ -20,4 +20,22 @@ const main = {
std.assert(!std.isalnum('!'), "! should not be isalnum\n")
std.assert(!std.isspace('@'), "@ should not be isspace\n")
std.assert(!std.isblank('@'), "@ should not be isblank\n")
+
+ std.assert(std.cellwidth(std.Badchar) == -1, "Badchar should have width -1\n")
+ std.assert(std.cellwidth((0 : char)) == 0, "U+0000 should have width 0\n")
+ std.assert(std.cellwidth('') == -1, "^E should have width -1\n")
+ std.assert(std.cellwidth('a') == 1, "'a' should have width 1\n")
+ std.assert(std.cellwidth('ê') == 1, "'ê' should have width 1\n")
+ std.assert(std.cellwidth('̀') == 0, "U+300 should have width 0\n")
+ std.assert(std.cellwidth('ϼ') == 1, "ϼ should have width 1\n")
+ std.assert(std.cellwidth('Ї') == 1, "Ї should have width 1\n")
+ std.assert(std.cellwidth('⊲') == 1, "⊲ should have width 1\n")
+ std.assert(std.cellwidth(' ') == 2, "U+3000 should have width 2\n")
+ std.assert(std.cellwidth('ギ') == 2, "ギ should have width 2\n")
+ std.assert(std.cellwidth('匌') == 2, "匌 should have width 2\n")
+ std.assert(std.cellwidth('­') == 0, "U+00AD should have width 0\n")
+ std.assert(std.cellwidth('ࠠ') == 0, "U+820 should have width 0\n")
+ std.assert(std.cellwidth('־') == 1, "U+5BE should have width 1\n")
+ std.assert(std.cellwidth('ֿ') == 0, "U+5BF should have width 0\n")
+ std.assert(std.cellwidth('׀') == 1, "U+5C0 should have width 1\n")
}