compiler/
lib/
examples/
std/
arch/
char/
tests.rad
1.5 KiB
collections/
lang/
sys/
arch.rad
68 B
char.rad
855 B
collections.rad
39 B
fmt.rad
8.5 KiB
intrinsics.rad
391 B
io.rad
1.3 KiB
lang.rad
258 B
mem.rad
2.2 KiB
sys.rad
173 B
testing.rad
2.4 KiB
tests.rad
14.8 KiB
vec.rad
3.2 KiB
std.rad
281 B
scripts/
seed/
sublime/
test/
vim/
.gitignore
366 B
.gitsigners
112 B
LICENSE
1.1 KiB
Makefile
3.6 KiB
README
2.5 KiB
STYLE
2.5 KiB
std.lib
1.2 KiB
std.lib.test
347 B
lib/std/char/tests.rad
raw
| 1 | use std::testing; |
| 2 | |
| 3 | @test fn testIsDigit() throws (testing::TestError) { |
| 4 | try testing::expect(super::isDigit('0')); |
| 5 | try testing::expect(super::isDigit('9')); |
| 6 | try testing::expectNot(super::isDigit('/')); |
| 7 | try testing::expectNot(super::isDigit(':')); |
| 8 | } |
| 9 | |
| 10 | @test fn testIsHexDigit() throws (testing::TestError) { |
| 11 | try testing::expect(super::isHexDigit('0')); |
| 12 | try testing::expect(super::isHexDigit('9')); |
| 13 | try testing::expect(super::isHexDigit('a')); |
| 14 | try testing::expect(super::isHexDigit('f')); |
| 15 | try testing::expect(super::isHexDigit('A')); |
| 16 | try testing::expect(super::isHexDigit('F')); |
| 17 | try testing::expectNot(super::isHexDigit('g')); |
| 18 | try testing::expectNot(super::isHexDigit('G')); |
| 19 | } |
| 20 | |
| 21 | @test fn testIsBinDigit() throws (testing::TestError) { |
| 22 | try testing::expect(super::isBinDigit('0')); |
| 23 | try testing::expect(super::isBinDigit('1')); |
| 24 | try testing::expectNot(super::isBinDigit('2')); |
| 25 | try testing::expectNot(super::isBinDigit('a')); |
| 26 | } |
| 27 | |
| 28 | @test fn testIsAlpha() throws (testing::TestError) { |
| 29 | try testing::expect(super::isAlpha('a')); |
| 30 | try testing::expect(super::isAlpha('z')); |
| 31 | try testing::expect(super::isAlpha('A')); |
| 32 | try testing::expect(super::isAlpha('Z')); |
| 33 | try testing::expectNot(super::isAlpha('0')); |
| 34 | try testing::expectNot(super::isAlpha('_')); |
| 35 | } |
| 36 | |
| 37 | @test fn testIsPrint() throws (testing::TestError) { |
| 38 | try testing::expect(super::isPrint(' ')); |
| 39 | try testing::expect(super::isPrint('~')); |
| 40 | try testing::expectNot(super::isPrint(31)); |
| 41 | try testing::expectNot(super::isPrint(127)); |
| 42 | } |