77 |
(pass-if (documented? odd?)) |
(pass-if (documented? odd?)) |
78 |
(pass-if (odd? 1)) |
(pass-if (odd? 1)) |
79 |
(pass-if (odd? -1)) |
(pass-if (odd? -1)) |
80 |
(expect-fail (odd? 0)) |
(pass-if (not (odd? 0))) |
81 |
(expect-fail (odd? 2)) |
(pass-if (not (odd? 2))) |
82 |
(expect-fail (odd? -2)) |
(pass-if (not (odd? -2))) |
83 |
(pass-if (odd? (+ (* 2 fixnum-max) 1))) |
(pass-if (odd? (+ (* 2 fixnum-max) 1))) |
84 |
(expect-fail (odd? (* 2 fixnum-max))) |
(pass-if (not (odd? (* 2 fixnum-max)))) |
85 |
(pass-if (odd? (- (* 2 fixnum-min) 1))) |
(pass-if (odd? (- (* 2 fixnum-min) 1))) |
86 |
(expect-fail (odd? (* 2 fixnum-min)))) |
(pass-if (not (odd? (* 2 fixnum-min))))) |
87 |
|
|
88 |
;;; |
;;; |
89 |
;;; even? |
;;; even? |
94 |
(pass-if (even? 2)) |
(pass-if (even? 2)) |
95 |
(pass-if (even? -2)) |
(pass-if (even? -2)) |
96 |
(pass-if (even? 0)) |
(pass-if (even? 0)) |
97 |
(expect-fail (even? 1)) |
(pass-if (not (even? 1))) |
98 |
(expect-fail (even? -1)) |
(pass-if (not (even? -1))) |
99 |
(expect-fail (even? (+ (* 2 fixnum-max) 1))) |
(pass-if (not (even? (+ (* 2 fixnum-max) 1)))) |
100 |
(pass-if (even? (* 2 fixnum-max))) |
(pass-if (even? (* 2 fixnum-max))) |
101 |
(expect-fail (even? (- (* 2 fixnum-min) 1))) |
(pass-if (not (even? (- (* 2 fixnum-min) 1)))) |
102 |
(pass-if (even? (* 2 fixnum-min)))) |
(pass-if (even? (* 2 fixnum-min)))) |
103 |
|
|
104 |
;;; |
;;; |
111 |
;; FIXME: what are the expected behaviors? |
;; FIXME: what are the expected behaviors? |
112 |
;; (pass-if (inf? (/ 1.0 0.0)) |
;; (pass-if (inf? (/ 1.0 0.0)) |
113 |
;; (pass-if (inf? (/ 1 0.0)) |
;; (pass-if (inf? (/ 1 0.0)) |
114 |
(expect-fail (inf? 0)) |
(pass-if (not (inf? 0))) |
115 |
(expect-fail (inf? 42.0)) |
(pass-if (not (inf? 42.0))) |
116 |
(expect-fail (inf? (+ fixnum-max 1))) |
(pass-if (not (inf? (+ fixnum-max 1)))) |
117 |
(expect-fail (inf? (- fixnum-min 1)))) |
(pass-if (not (inf? (- fixnum-min 1))))) |
118 |
|
|
119 |
;;; |
;;; |
120 |
;;; nan? and nan |
;;; nan? and nan |
124 |
(pass-if (documented? nan?)) |
(pass-if (documented? nan?)) |
125 |
(pass-if (nan? (nan))) |
(pass-if (nan? (nan))) |
126 |
;; FIXME: other ways we should be able to generate NaN? |
;; FIXME: other ways we should be able to generate NaN? |
127 |
(expect-fail (nan? 0)) |
(pass-if (not (nan? 0))) |
128 |
(expect-fail (nan? 42.0)) |
(pass-if (not (nan? 42.0))) |
129 |
(expect-fail (nan? (+ fixnum-max 1))) |
(pass-if (not (nan? (+ fixnum-max 1)))) |
130 |
(expect-fail (nan? (- fixnum-min 1)))) |
(pass-if (not (nan? (- fixnum-min 1))))) |
131 |
|
|
132 |
;;; |
;;; |
133 |
;;; abs |
;;; abs |
1031 |
(pass-if (number? (+ 1 fixnum-max))) |
(pass-if (number? (+ 1 fixnum-max))) |
1032 |
(pass-if (number? (- 1 fixnum-min))) |
(pass-if (number? (- 1 fixnum-min))) |
1033 |
(pass-if (number? 3+4i)) |
(pass-if (number? 3+4i)) |
1034 |
(expect-fail (number? #\a)) |
(pass-if (not (number? #\a))) |
1035 |
(expect-fail (number? "a")) |
(pass-if (not (number? "a"))) |
1036 |
(expect-fail (number? (make-vector 0))) |
(pass-if (not (number? (make-vector 0)))) |
1037 |
(expect-fail (number? (cons 1 2))) |
(pass-if (not (number? (cons 1 2)))) |
1038 |
(expect-fail (number? #t)) |
(pass-if (not (number? #t))) |
1039 |
(expect-fail (number? (lambda () #t))) |
(pass-if (not (number? (lambda () #t)))) |
1040 |
(expect-fail (number? (current-input-port)))) |
(pass-if (not (number? (current-input-port))))) |
1041 |
|
|
1042 |
;;; |
;;; |
1043 |
;;; complex? |
;;; complex? |
1052 |
(pass-if (complex? (- 1 fixnum-min))) |
(pass-if (complex? (- 1 fixnum-min))) |
1053 |
(pass-if (complex? 1.3)) |
(pass-if (complex? 1.3)) |
1054 |
(pass-if (complex? 3+4i)) |
(pass-if (complex? 3+4i)) |
1055 |
(expect-fail (complex? #\a)) |
(pass-if (not (complex? #\a))) |
1056 |
(expect-fail (complex? "a")) |
(pass-if (not (complex? "a"))) |
1057 |
(expect-fail (complex? (make-vector 0))) |
(pass-if (not (complex? (make-vector 0)))) |
1058 |
(expect-fail (complex? (cons 1 2))) |
(pass-if (not (complex? (cons 1 2)))) |
1059 |
(expect-fail (complex? #t)) |
(pass-if (not (complex? #t))) |
1060 |
(expect-fail (complex? (lambda () #t))) |
(pass-if (not (complex? (lambda () #t)))) |
1061 |
(expect-fail (complex? (current-input-port)))) |
(pass-if (not (complex? (current-input-port))))) |
1062 |
|
|
1063 |
;;; |
;;; |
1064 |
;;; real? |
;;; real? |
1072 |
(pass-if (real? (+ 1 fixnum-max))) |
(pass-if (real? (+ 1 fixnum-max))) |
1073 |
(pass-if (real? (- 1 fixnum-min))) |
(pass-if (real? (- 1 fixnum-min))) |
1074 |
(pass-if (real? 1.3)) |
(pass-if (real? 1.3)) |
1075 |
(expect-fail (real? 3+4i)) |
(pass-if (not (real? 3+4i))) |
1076 |
(expect-fail (real? #\a)) |
(pass-if (not (real? #\a))) |
1077 |
(expect-fail (real? "a")) |
(pass-if (not (real? "a"))) |
1078 |
(expect-fail (real? (make-vector 0))) |
(pass-if (not (real? (make-vector 0)))) |
1079 |
(expect-fail (real? (cons 1 2))) |
(pass-if (not (real? (cons 1 2)))) |
1080 |
(expect-fail (real? #t)) |
(pass-if (not (real? #t))) |
1081 |
(expect-fail (real? (lambda () #t))) |
(pass-if (not (real? (lambda () #t)))) |
1082 |
(expect-fail (real? (current-input-port)))) |
(pass-if (not (real? (current-input-port))))) |
1083 |
|
|
1084 |
;;; |
;;; |
1085 |
;;; rational? (same as real? right now) |
;;; rational? (same as real? right now) |
1093 |
(pass-if (rational? (+ 1 fixnum-max))) |
(pass-if (rational? (+ 1 fixnum-max))) |
1094 |
(pass-if (rational? (- 1 fixnum-min))) |
(pass-if (rational? (- 1 fixnum-min))) |
1095 |
(pass-if (rational? 1.3)) |
(pass-if (rational? 1.3)) |
1096 |
(expect-fail (rational? 3+4i)) |
(pass-if (not (rational? 3+4i))) |
1097 |
(expect-fail (rational? #\a)) |
(pass-if (not (rational? #\a))) |
1098 |
(expect-fail (rational? "a")) |
(pass-if (not (rational? "a"))) |
1099 |
(expect-fail (rational? (make-vector 0))) |
(pass-if (not (rational? (make-vector 0)))) |
1100 |
(expect-fail (rational? (cons 1 2))) |
(pass-if (not (rational? (cons 1 2)))) |
1101 |
(expect-fail (rational? #t)) |
(pass-if (not (rational? #t))) |
1102 |
(expect-fail (rational? (lambda () #t))) |
(pass-if (not (rational? (lambda () #t)))) |
1103 |
(expect-fail (rational? (current-input-port)))) |
(pass-if (not (rational? (current-input-port))))) |
1104 |
|
|
1105 |
;;; |
;;; |
1106 |
;;; integer? |
;;; integer? |
1115 |
(pass-if (integer? (- 1 fixnum-min))) |
(pass-if (integer? (- 1 fixnum-min))) |
1116 |
(pass-if (and (= 3+0i (round 3+0i)) (integer? 3+0i))) |
(pass-if (and (= 3+0i (round 3+0i)) (integer? 3+0i))) |
1117 |
(pass-if (and (= 1.0 (round 1.0)) (integer? 1.0))) |
(pass-if (and (= 1.0 (round 1.0)) (integer? 1.0))) |
1118 |
(expect-fail (integer? 1.3)) |
(pass-if (not (integer? 1.3))) |
1119 |
(expect-fail (integer? 3+4i)) |
(pass-if (not (integer? 3+4i))) |
1120 |
(expect-fail (integer? #\a)) |
(pass-if (not (integer? #\a))) |
1121 |
(expect-fail (integer? "a")) |
(pass-if (not (integer? "a"))) |
1122 |
(expect-fail (integer? (make-vector 0))) |
(pass-if (not (integer? (make-vector 0)))) |
1123 |
(expect-fail (integer? (cons 1 2))) |
(pass-if (not (integer? (cons 1 2)))) |
1124 |
(expect-fail (integer? #t)) |
(pass-if (not (integer? #t))) |
1125 |
(expect-fail (integer? (lambda () #t))) |
(pass-if (not (integer? (lambda () #t)))) |
1126 |
(expect-fail (integer? (current-input-port)))) |
(pass-if (not (integer? (current-input-port))))) |
1127 |
|
|
1128 |
;;; |
;;; |
1129 |
;;; inexact? |
;;; inexact? |
1131 |
|
|
1132 |
(with-test-prefix "inexact?" |
(with-test-prefix "inexact?" |
1133 |
(pass-if (documented? inexact?)) |
(pass-if (documented? inexact?)) |
1134 |
(expect-fail (inexact? 0)) |
(pass-if (not (inexact? 0))) |
1135 |
(expect-fail (inexact? 7)) |
(pass-if (not (inexact? 7))) |
1136 |
(expect-fail (inexact? -7)) |
(pass-if (not (inexact? -7))) |
1137 |
(expect-fail (inexact? (+ 1 fixnum-max))) |
(pass-if (not (inexact? (+ 1 fixnum-max)))) |
1138 |
(expect-fail (inexact? (- 1 fixnum-min))) |
(pass-if (not (inexact? (- 1 fixnum-min)))) |
1139 |
(pass-if (inexact? 1.3)) |
(pass-if (inexact? 1.3)) |
1140 |
(pass-if (inexact? 3.1+4.2i)) |
(pass-if (inexact? 3.1+4.2i)) |
1141 |
(expect-fail (inexact? #\a)) |
(pass-if (not (inexact? #\a))) |
1142 |
(expect-fail (inexact? "a")) |
(pass-if (not (inexact? "a"))) |
1143 |
(expect-fail (inexact? (make-vector 0))) |
(pass-if (not (inexact? (make-vector 0)))) |
1144 |
(expect-fail (inexact? (cons 1 2))) |
(pass-if (not (inexact? (cons 1 2)))) |
1145 |
(expect-fail (inexact? #t)) |
(pass-if (not (inexact? #t))) |
1146 |
(expect-fail (inexact? (lambda () #t))) |
(pass-if (not (inexact? (lambda () #t)))) |
1147 |
(expect-fail (inexact? (current-input-port)))) |
(pass-if (not (inexact? (current-input-port))))) |
1148 |
|
|
1149 |
;;; |
;;; |
1150 |
;;; = |
;;; = |
1157 |
(pass-if (= -7 -7)) |
(pass-if (= -7 -7)) |
1158 |
(pass-if (= (+ 1 fixnum-max) (+ 1 fixnum-max))) |
(pass-if (= (+ 1 fixnum-max) (+ 1 fixnum-max))) |
1159 |
(pass-if (= (- 1 fixnum-min) (- 1 fixnum-min))) |
(pass-if (= (- 1 fixnum-min) (- 1 fixnum-min))) |
1160 |
(expect-fail (= 0 1)) |
(pass-if (not (= 0 1))) |
1161 |
(expect-fail (= fixnum-max (+ 1 fixnum-max))) |
(pass-if (not (= fixnum-max (+ 1 fixnum-max)))) |
1162 |
(expect-fail (= (+ 1 fixnum-max) fixnum-max)) |
(pass-if (not (= (+ 1 fixnum-max) fixnum-max))) |
1163 |
(expect-fail (= fixnum-min (- fixnum-min 1))) |
(pass-if (not (= fixnum-min (- fixnum-min 1)))) |
1164 |
(expect-fail (= (- fixnum-min 1) fixnum-min)) |
(pass-if (not (= (- fixnum-min 1) fixnum-min))) |
1165 |
(expect-fail (= (+ fixnum-max 1) (- fixnum-min 1))) |
(pass-if (not (= (+ fixnum-max 1) (- fixnum-min 1)))) |
1166 |
|
|
1167 |
(pass-if (not (= (ash 1 256) +inf.0))) |
(pass-if (not (= (ash 1 256) +inf.0))) |
1168 |
(pass-if (not (= +inf.0 (ash 1 256)))) |
(pass-if (not (= +inf.0 (ash 1 256)))) |
1606 |
(with-test-prefix "zero?" |
(with-test-prefix "zero?" |
1607 |
(expect-fail (documented? zero?)) |
(expect-fail (documented? zero?)) |
1608 |
(pass-if (zero? 0)) |
(pass-if (zero? 0)) |
1609 |
(expect-fail (zero? 7)) |
(pass-if (not (zero? 7))) |
1610 |
(expect-fail (zero? -7)) |
(pass-if (not (zero? -7))) |
1611 |
(expect-fail (zero? (+ 1 fixnum-max))) |
(pass-if (not (zero? (+ 1 fixnum-max)))) |
1612 |
(expect-fail (zero? (- 1 fixnum-min))) |
(pass-if (not (zero? (- 1 fixnum-min)))) |
1613 |
(expect-fail (zero? 1.3)) |
(pass-if (not (zero? 1.3))) |
1614 |
(expect-fail (zero? 3.1+4.2i))) |
(pass-if (not (zero? 3.1+4.2i)))) |
1615 |
|
|
1616 |
;;; |
;;; |
1617 |
;;; positive? |
;;; positive? |
1622 |
(pass-if (positive? 1)) |
(pass-if (positive? 1)) |
1623 |
(pass-if (positive? (+ fixnum-max 1))) |
(pass-if (positive? (+ fixnum-max 1))) |
1624 |
(pass-if (positive? 1.3)) |
(pass-if (positive? 1.3)) |
1625 |
(expect-fail (positive? 0)) |
(pass-if (not (positive? 0))) |
1626 |
(expect-fail (positive? -1)) |
(pass-if (not (positive? -1))) |
1627 |
(expect-fail (positive? (- fixnum-min 1))) |
(pass-if (not (positive? (- fixnum-min 1)))) |
1628 |
(expect-fail (positive? -1.3))) |
(pass-if (not (positive? -1.3)))) |
1629 |
|
|
1630 |
;;; |
;;; |
1631 |
;;; negative? |
;;; negative? |
1633 |
|
|
1634 |
(with-test-prefix "negative?" |
(with-test-prefix "negative?" |
1635 |
(expect-fail (documented? negative?)) |
(expect-fail (documented? negative?)) |
1636 |
(expect-fail (negative? 1)) |
(pass-if (not (negative? 1))) |
1637 |
(expect-fail (negative? (+ fixnum-max 1))) |
(pass-if (not (negative? (+ fixnum-max 1)))) |
1638 |
(expect-fail (negative? 1.3)) |
(pass-if (not (negative? 1.3))) |
1639 |
(expect-fail (negative? 0)) |
(pass-if (not (negative? 0))) |
1640 |
(pass-if (negative? -1)) |
(pass-if (negative? -1)) |
1641 |
(pass-if (negative? (- fixnum-min 1))) |
(pass-if (negative? (- fixnum-min 1))) |
1642 |
(pass-if (negative? -1.3))) |
(pass-if (negative? -1.3))) |