diff options
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/char.lisp | 34 | ||||
| -rw-r--r-- | tests/test.lisp | 2 |
2 files changed, 36 insertions, 0 deletions
diff --git a/tests/char.lisp b/tests/char.lisp new file mode 100644 index 0000000..2218671 --- /dev/null +++ b/tests/char.lisp @@ -0,0 +1,34 @@ +(assert (char? #\a)) +(assert (not (char? 1))) +(assert (not (char? (cons 1 2)))) +(assert (not (char? "a"))) + +(assert (char= #\a #\a)) +(assert (char>= #\a #\a)) +(assert (char<= #\a #\a)) +(assert (char< #\a #\b)) +(assert (char> #\b #\a)) +(assert (char<= #\a #\b)) +(assert (char>= #\b #\a)) +(assert (char/= #\b #\a)) + +(assert (not (char/= #\a #\a))) +(assert (not (char< #\a #\a))) +(assert (not (char> #\a #\a))) +(assert (not (char>= #\a #\b))) +(assert (not (char<= #\b #\a))) +(assert (not (char> #\a #\b))) +(assert (not (char< #\b #\a))) +(assert (not (char= #\b #\a))) + +(assert (= 97 (char->int #\a))) +(assert (char= #\a (int->char 97))) + +(assert (alphabetic? #\a)) +(assert (alphanum? #\a)) +(assert (alphanum? #\1)) +(assert (numeric? #\1)) +(assert (not (numeric? #\a))) +(assert (not (alphabetic? #\1))) +(assert (not (alphanum? #\,))) + diff --git a/tests/test.lisp b/tests/test.lisp index 8969a5b..5d5d807 100644 --- a/tests/test.lisp +++ b/tests/test.lisp @@ -20,6 +20,7 @@ (test-module string) (test-module list) (test-module type) +(test-module char) (princ "\n\nTest with intensive GC:\n\n") (_alwaysgc #t) @@ -39,5 +40,6 @@ (test-module string) (test-module list) (test-module type) +(test-module char) (exit) |
