summaryrefslogtreecommitdiff
path: root/lib/std/test/chartype.myr
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2015-08-26 12:20:58 -0700
committerOri Bernstein <ori@eigenstate.org>2015-08-26 12:20:58 -0700
commit2bc852bda98762d3bc01548bf972e3f1b137fbfb (patch)
tree74831deed3c9057c5fe0cbb8790d220e855bc792 /lib/std/test/chartype.myr
parent3de952510eb2a23350d24ed926f19c0cf72a12f2 (diff)
downloadmc-2bc852bda98762d3bc01548bf972e3f1b137fbfb.tar.gz
Move Myrddin libs to lib/ subdirectory.
Diffstat (limited to 'lib/std/test/chartype.myr')
-rw-r--r--lib/std/test/chartype.myr23
1 files changed, 23 insertions, 0 deletions
diff --git a/lib/std/test/chartype.myr b/lib/std/test/chartype.myr
new file mode 100644
index 0000000..d0df1d2
--- /dev/null
+++ b/lib/std/test/chartype.myr
@@ -0,0 +1,23 @@
+use std
+
+const main = {
+ std.assert(std.isalpha('a'), "a should be alpha\n")
+ std.assert(std.isupper('A'), "A should be upper\n")
+ std.assert(std.islower('a'), "a should be lower\n")
+ std.assert(std.isdigit('0'), "0 should be isdigit\n")
+ std.assert(std.isnum('\u{0c66}'), "\u{0c66} should be isnum\n")
+ std.assert(std.isalnum('a'), "a should be isalnum\n")
+ std.assert(std.isalnum('0'), "0 should be isalnum\n")
+ std.assert(std.isspace(' '), "' ' should be isspace\n")
+ std.assert(std.isblank(' '), "' ' should be isblank\n")
+
+ std.assert(!std.isalpha('0'), "0 should not be alpha\n")
+ std.assert(!std.isupper('a'), "a should not be upper\n")
+ std.assert(!std.islower('A'), "A should not be lower\n")
+ std.assert(!std.isdigit('a'), "a should not be isdigit\n")
+ std.assert(!std.isnum('a'), " should not be isnum\n")
+ std.assert(!std.isalnum('}'), "a should not be isalnum\n")
+ 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")
+}