~tim/scheme-vm

ref: 7b7818923d1586b72f9054ceb2c9ad2cecfdf82b scheme-vm/spec/lib/char-spec.scm -rw-r--r-- 727 bytes View raw
7b781892Tim Morgan Rewrite list=? function to be a bit faster 2 years ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
(import (scheme base)
        (assert))

(assert (= 48 (char->integer #\0)))

(assert (= #\0 (integer->char 48)))
(assert (not (= #\1 (integer->char 48))))

(assert (eq? #\a (char-downcase #\A)))
(assert (eq? #\a (char-downcase #\a)))

(assert (eq? #\A (char-upcase #\a)))
(assert (eq? #\A (char-upcase #\A)))

(assert (char=? #\a #\a))
(assert (not (char=? #\a #\b)))

(assert (char<? #\a #\b))
(assert (not (char<? #\a #\a)))
(assert (not (char<? #\b #\a)))

(assert (char<=? #\a #\b))
(assert (char<=? #\a #\a))
(assert (not (char<=? #\b #\a)))

(assert (char>? #\b #\a))
(assert (not (char>? #\b #\b)))
(assert (not (char>? #\a #\b)))

(assert (char>=? #\b #\a))
(assert (char>=? #\b #\b))
(assert (not (char>=? #\a #\b)))