summaryrefslogtreecommitdiff
path: root/libstd/test/chartype.myr
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2015-02-21 22:42:42 -0800
committerOri Bernstein <ori@eigenstate.org>2015-02-21 22:42:42 -0800
commit73b28cf5864bbe111dd5bf3fd47ea03090130d0f (patch)
treeb1a58bdcd2af9f2cd0a41525f3b7ef1b2ee1cb01 /libstd/test/chartype.myr
parent64141a6e1d3bd0c0d648563e9333d3395fd7df86 (diff)
downloadmc-73b28cf5864bbe111dd5bf3fd47ea03090130d0f.tar.gz
Start adding in some unit tests to run with mbld.
Diffstat (limited to 'libstd/test/chartype.myr')
-rw-r--r--libstd/test/chartype.myr25
1 files changed, 25 insertions, 0 deletions
diff --git a/libstd/test/chartype.myr b/libstd/test/chartype.myr
new file mode 100644
index 0000000..f77b29e
--- /dev/null
+++ b/libstd/test/chartype.myr
@@ -0,0 +1,25 @@
+use "chartype.use"
+
+use "die.use"
+
+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")
+}