Debian Codegraph @

scheme/tests/tests-1.3-req.scm

raw
1
2
3
4 (add-tests-with-string-output "fxadd1"
5 [($fxadd1 0) => "1\n"]
6 [($fxadd1 -1) => "0\n"]
7 [($fxadd1 1) => "2\n"]
8 [($fxadd1 -100) => "-99\n"]
9 [($fxadd1 1000) => "1001\n"]
10 [($fxadd1 536870910) => "536870911\n"]
11 [($fxadd1 -536870912) => "-536870911\n"]
12 [($fxadd1 ($fxadd1 0)) => "2\n"]
13 [($fxadd1 ($fxadd1 ($fxadd1 ($fxadd1 ($fxadd1 ($fxadd1 12)))))) => "18\n"]
14 )
15
16 (add-tests-with-string-output "fixnum->char and char->fixnum"
17 [($fixnum->char 65) => "#\\A\n"]
18 [($fixnum->char 97) => "#\\a\n"]
19 [($fixnum->char 122) => "#\\z\n"]
20 [($fixnum->char 90) => "#\\Z\n"]
21 [($fixnum->char 48) => "#\\0\n"]
22 [($fixnum->char 57) => "#\\9\n"]
23 [($char->fixnum #\A) => "65\n"]
24 [($char->fixnum #\a) => "97\n"]
25 [($char->fixnum #\z) => "122\n"]
26 [($char->fixnum #\Z) => "90\n"]
27 [($char->fixnum #\0) => "48\n"]
28 [($char->fixnum #\9) => "57\n"]
29 [($char->fixnum ($fixnum->char 12)) => "12\n"]
30 [($fixnum->char ($char->fixnum #\x)) => "#\\x\n"]
31 )
32
33 (add-tests-with-string-output "fixnum?"
34 [(fixnum? 0) => "#t\n"]
35 [(fixnum? 1) => "#t\n"]
36 [(fixnum? -1) => "#t\n"]
37 [(fixnum? 37287) => "#t\n"]
38 [(fixnum? -23873) => "#t\n"]
39 [(fixnum? 536870911) => "#t\n"]
40 [(fixnum? -536870912) => "#t\n"]
41 [(fixnum? #t) => "#f\n"]
42 [(fixnum? #f) => "#f\n"]
43 [(fixnum? ()) => "#f\n"]
44 [(fixnum? #\Q) => "#f\n"]
45 [(fixnum? (fixnum? 12)) => "#f\n"]
46 [(fixnum? (fixnum? #f)) => "#f\n"]
47 [(fixnum? (fixnum? #\A)) => "#f\n"]
48 [(fixnum? ($char->fixnum #\r)) => "#t\n"]
49 [(fixnum? ($fixnum->char 12)) => "#f\n"]
50 )
51
52
53 (add-tests-with-string-output "fxzero?"
54 [($fxzero? 0) => "#t\n"]
55 [($fxzero? 1) => "#f\n"]
56 [($fxzero? -1) => "#f\n"]
57 )
58
59 (add-tests-with-string-output "null?"
60 [(null? ()) => "#t\n"]
61 [(null? #f) => "#f\n"]
62 [(null? #t) => "#f\n"]
63 [(null? (null? ())) => "#f\n"]
64 [(null? #\a) => "#f\n"]
65 [(null? 0) => "#f\n"]
66 [(null? -10) => "#f\n"]
67 [(null? 10) => "#f\n"]
68 )
69
70 (add-tests-with-string-output "boolean?"
71 [(boolean? #t) => "#t\n"]
72 [(boolean? #f) => "#t\n"]
73 [(boolean? 0) => "#f\n"]
74 [(boolean? 1) => "#f\n"]
75 [(boolean? -1) => "#f\n"]
76 [(boolean? ()) => "#f\n"]
77 [(boolean? #\a) => "#f\n"]
78 [(boolean? (boolean? 0)) => "#t\n"]
79 [(boolean? (fixnum? (boolean? 0))) => "#t\n"]
80 )
81
82 (add-tests-with-string-output "char?"
83 [(char? #\a) => "#t\n"]
84 [(char? #\Z) => "#t\n"]
85 [(char? #\newline) => "#t\n"]
86 [(char? #t) => "#f\n"]
87 [(char? #f) => "#f\n"]
88 [(char? ()) => "#f\n"]
89 [(char? (char? #t)) => "#f\n"]
90 [(char? 0) => "#f\n"]
91 [(char? 23870) => "#f\n"]
92 [(char? -23789) => "#f\n"]
93 )
94
95 (add-tests-with-string-output "not"
96 [(not #t) => "#f\n"]
97 [(not #f) => "#t\n"]
98 [(not 15) => "#f\n"]
99 [(not ()) => "#f\n"]
100 [(not #\A) => "#f\n"]
101 [(not (not #t)) => "#t\n"]
102 [(not (not #f)) => "#f\n"]
103 [(not (not 15)) => "#t\n"]
104 [(not (fixnum? 15)) => "#f\n"]
105 [(not (fixnum? #f)) => "#t\n"]
106 )
107
108 (add-tests-with-string-output "fxlognot"
109 [($fxlognot 0) => "-1\n"]
110 [($fxlognot -1) => "0\n"]
111 [($fxlognot 1) => "-2\n"]
112 [($fxlognot -2) => "1\n"]
113 [($fxlognot 536870911) => "-536870912\n"]
114 [($fxlognot -536870912) => "536870911\n"]
115 [($fxlognot ($fxlognot 237463)) => "237463\n"]
116 )
117