Skip to content

Commit 48555c3

Browse files
authored
Update more tests in cptypes.ms
1 parent 8044b41 commit 48555c3

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

mats/cptypes.ms

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -878,16 +878,45 @@
878878
(add1 x)))
879879
'(lambda (x) (when (flonum? x)
880880
(#3%fl+ x 1.0))))
881+
(cptypes-equivalent-expansion?
882+
'(lambda (x) (when (fixnum? x)
883+
(let ([y (sub1 x)])
884+
(and (integer? y) (exact? y)))))
885+
'(lambda (x) (when (fixnum? x)
886+
(let ([y (sub1 x)])
887+
#t))))
888+
(cptypes-equivalent-expansion?
889+
'(lambda (x) (when (real? x)
890+
(real? (sub1 x))))
891+
'(lambda (x) (when (real? x)
892+
#t)))
893+
(cptypes-equivalent-expansion?
894+
'(lambda (x) (when (flonum? x)
895+
(flonum? (sub1 x))))
896+
'(lambda (x) (when (flonum? x)
897+
#t)))
881898
(cptypes-equivalent-expansion?
882899
'(lambda (x) (when (flonum? x)
883900
(sub1 x)))
884901
'(lambda (x) (when (flonum? x)
885902
(#3%fl- x 1.0))))
903+
(cptypes-equivalent-expansion?
904+
'(lambda (x) (when (fixnum? x)
905+
(let ([y (abs x)])
906+
(and (integer? y) (exact? y)))))
907+
'(lambda (x) (when (fixnum? x)
908+
(let ([y (abs x)])
909+
#t))))
886910
(cptypes-equivalent-expansion?
887911
'(lambda (x) (when (real? x)
888912
(real? (abs x))))
889913
'(lambda (x) (when (real? x)
890914
#t)))
915+
(cptypes-equivalent-expansion?
916+
'(lambda (x) (when (flonum? x)
917+
(flonum? (abs x))))
918+
'(lambda (x) (when (flonum? x)
919+
#t)))
891920
)
892921

893922
(mat cptypes-rest-argument

0 commit comments

Comments
 (0)