Skip to content

Commit 8044b41

Browse files
authored
Update tests in cptypes.ms
1 parent 9eaf47d commit 8044b41

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

mats/cptypes.ms

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -856,6 +856,38 @@
856856
(not (cptypes-equivalent-expansion?
857857
'(lambda (x) (#2%exact? x))
858858
'(lambda (x) (#3%exact? x))))
859+
(cptypes-equivalent-expansion?
860+
'(lambda (x) (when (fixnum? x)
861+
(let ([y (add1 x)])
862+
(and (integer? y) (exact? y)))))
863+
'(lambda (x) (when (fixnum? x)
864+
(let ([y (add1 x)])
865+
#t))))
866+
(cptypes-equivalent-expansion?
867+
'(lambda (x) (when (real? x)
868+
(real? (add1 x))))
869+
'(lambda (x) (when (real? x)
870+
#t)))
871+
(cptypes-equivalent-expansion?
872+
'(lambda (x) (when (flonum? x)
873+
(flonum? (add1 x))))
874+
'(lambda (x) (when (flonum? x)
875+
#t)))
876+
(cptypes-equivalent-expansion?
877+
'(lambda (x) (when (flonum? x)
878+
(add1 x)))
879+
'(lambda (x) (when (flonum? x)
880+
(#3%fl+ x 1.0))))
881+
(cptypes-equivalent-expansion?
882+
'(lambda (x) (when (flonum? x)
883+
(sub1 x)))
884+
'(lambda (x) (when (flonum? x)
885+
(#3%fl- x 1.0))))
886+
(cptypes-equivalent-expansion?
887+
'(lambda (x) (when (real? x)
888+
(real? (abs x))))
889+
'(lambda (x) (when (real? x)
890+
#t)))
859891
)
860892

861893
(mat cptypes-rest-argument

0 commit comments

Comments
 (0)