From da9f5bd61a462920151b4a68a18f5713542444da Mon Sep 17 00:00:00 2001 From: Robby Findler Date: Thu, 5 Aug 2010 15:33:56 -0500 Subject: [PATCH] fixed a few bugs in the ->i implementation and the test suite. --- collects/tests/racket/contract-test.rktl | 29 ++++++++++++------------ 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/collects/tests/racket/contract-test.rktl b/collects/tests/racket/contract-test.rktl index ac807eae9d..a6adb6fff7 100644 --- a/collects/tests/racket/contract-test.rktl +++ b/collects/tests/racket/contract-test.rktl @@ -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