fixed a few bugs in the ->i implementation and the test suite.

This commit is contained in:
Robby Findler 2010-08-05 15:33:56 -05:00
parent 10b6e58dd0
commit da9f5bd61a

View File

@ -1963,7 +1963,7 @@
(test/spec-passed
'->i-values7
'((contract (->i ([x number?] [y (x) (<=/c x)]) () (values [z boolean?] [w (<=/c x)]))
'((contract (->i ([x number?] [y (x) (<=/c x)]) () (values [z boolean?] [w (x) (<=/c x)]))
(lambda (x y) (values #t (- x 1)))
'pos
'neg)
@ -2076,7 +2076,7 @@
(test/spec-passed/result
'->i23
'((contract (->i ((i number?) (j (and/c number? (>=/c i)))) () [r number?])
'((contract (->i ((i number?) (j (i) (and/c number? (>=/c i)))) () [r number?])
(λ (i j) 1)
'pos
'neg)
@ -2414,9 +2414,9 @@
([a number?] [b number?] #:c [c number?] #:d [d number?])
#:rest [rest any/c]
(values [p number?] [q number?] [r number?])
#:post (x y z w a b c d)
(equal? (list x y z w a b c d rest p q r)
(list 1 2 3 4 5 6 7 8 '(z) 11 12 13)))
#:post (x y z w a b c d rest p q r)
(equal? (list x y z w a b c d rest p q r)
(list 1 2 3 4 5 6 7 8 '(z) 11 12 13)))
(λ (x y #:z z #:w w [a 101] [b 102] #:c [c 103] #:d [d 104] . rest)
(values 11 12 13))
'pos
@ -2449,11 +2449,11 @@
([a number?] [b number?] #:c [c number?] #:d [d number?])
#:rest [rest any/c]
(values [p number?] [q number?] [r number?])
#:post (x y z w a b c d rest)
(equal? (list x y z w a b c d rest p q r)
(list 1 2 3 4
the-unsupplied-arg the-unsupplied-arg the-unsupplied-arg the-unsupplied-arg
'() 11 12 13)))
#:post (x y z w a b c d rest p q r)
(equal? (list x y z w a b c d rest p q r)
(list 1 2 3 4
the-unsupplied-arg the-unsupplied-arg the-unsupplied-arg the-unsupplied-arg
'() 11 12 13)))
(λ (x y #:z z #:w w [a 101] [b 102] #:c [c 103] #:d [d 104] . rest)
(values 11 12 13))
'pos
@ -2467,7 +2467,7 @@
([a number?])
#:rest [rest any/c]
[_ any/c]
#:post (a) (equal? (list a rest) (list the-unsupplied-arg '())))
#:post (a rest) (equal? (list a rest) (list the-unsupplied-arg '())))
(λ ([a 1] . rest) 1)
'pos
'neg)))
@ -2476,7 +2476,8 @@
'->i-underscore1
'((contract (->i ([b (box/c integer?)])
()
[_ (let ([old (unbox b)])
[_ (b)
(let ([old (unbox b)])
(and/c
void?
(λ (new)
@ -4849,7 +4850,7 @@
'pos
'neg)
m))
#|
(test/spec-passed
'object-contract-->i1
'(send (contract (object-contract (m (->i ([x number?]) () [range (x) (<=/c x)])))
@ -5126,7 +5127,7 @@
'pos
'neg)
m))
|#
(test/spec-passed/result
'object-contract-drop-method1