cs: adjust some tests to pass

This commit is contained in:
Matthew Flatt 2019-01-16 20:41:04 -07:00
parent cddcd57267
commit b5cce5fcab
2 changed files with 10 additions and 6 deletions

View File

@ -615,7 +615,7 @@
#rx".*expected number of values not received.*")
(err/rt-test (begin (for/fold ([x 1]) () (values 1 2)) 1)
exn:fail:contract:arity?
#rx".*expected number of values not received.*")
#rx"expected number of values not received|returned two values to single value return context")
(err/rt-test (begin (for/fold ([x 1] [y 2]) ([i (in-range 10)]) 1) 1)
exn:fail:contract:arity?
#rx".*expected number of values not received.*")
@ -692,7 +692,7 @@
#rx"expected: hash\\?")
(err/rt-test (for ([x (in-hash (hash 1 2))]) x)
exn:fail:contract:arity?
#rx"expected number of values not received")
#rx"expected number of values not received|returned two values to single value return context")
(err/rt-test (for ([x (in-hash 1 2 3)]) x)
exn:fail:contract:arity?)

View File

@ -56,10 +56,14 @@
((abs (- x y)) . < . #e1e-10))))
(define (single=? x y)
(and (single-flonum? y)
(let ([x (inexact->exact x)]
[y (inexact->exact y)])
((abs (- x y)) . < . #e1e-6))))
(cond
[(eq? 'chez-scheme (system-type 'vm))
(double=? x y)]
[else
(and (single-flonum? y)
(let ([x (inexact->exact x)]
[y (inexact->exact y)])
((abs (- x y)) . < . #e1e-6)))]))
;; =========================================================================
;; pi