Skip to content

Commit

Permalink
Update more tests in cptypes.ms
Browse files Browse the repository at this point in the history
  • Loading branch information
gus-massa authored Jan 8, 2024
1 parent 8044b41 commit 48555c3
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions mats/cptypes.ms
Original file line number Diff line number Diff line change
Expand Up @@ -878,16 +878,45 @@
(add1 x)))
'(lambda (x) (when (flonum? x)
(#3%fl+ x 1.0))))
(cptypes-equivalent-expansion?
'(lambda (x) (when (fixnum? x)
(let ([y (sub1 x)])
(and (integer? y) (exact? y)))))
'(lambda (x) (when (fixnum? x)
(let ([y (sub1 x)])
#t))))
(cptypes-equivalent-expansion?
'(lambda (x) (when (real? x)
(real? (sub1 x))))
'(lambda (x) (when (real? x)
#t)))
(cptypes-equivalent-expansion?
'(lambda (x) (when (flonum? x)
(flonum? (sub1 x))))
'(lambda (x) (when (flonum? x)
#t)))
(cptypes-equivalent-expansion?
'(lambda (x) (when (flonum? x)
(sub1 x)))
'(lambda (x) (when (flonum? x)
(#3%fl- x 1.0))))
(cptypes-equivalent-expansion?
'(lambda (x) (when (fixnum? x)
(let ([y (abs x)])
(and (integer? y) (exact? y)))))
'(lambda (x) (when (fixnum? x)
(let ([y (abs x)])
#t))))
(cptypes-equivalent-expansion?
'(lambda (x) (when (real? x)
(real? (abs x))))
'(lambda (x) (when (real? x)
#t)))
(cptypes-equivalent-expansion?
'(lambda (x) (when (flonum? x)
(flonum? (abs x))))
'(lambda (x) (when (flonum? x)
#t)))
)

(mat cptypes-rest-argument
Expand Down

0 comments on commit 48555c3

Please sign in to comment.