fixed PR 7999 and added one-of/c to the contract library

svn: r2650

original commit: 1c97b4c21f978136b5c52c838f9a1cd4ac17bd1f
This commit is contained in:
Robby Findler 2006-04-10 03:54:55 +00:00
parent 0b8cbd5825
commit f3d91012e7

View File

@ -3774,6 +3774,8 @@
(test/spec-passed 'any/c '(contract any/c 1 'pos 'neg))
(test-flat-contract 'printable/c (vector (cons 1 (box #f))) (lambda (x) x))
(test-flat-contract '(symbols 'a 'b 'c) 'a 'd)
(test-flat-contract '(one-of/c (expt 2 65)) (expt 2 65) 12)
(test-flat-contract '(one-of/c #:x #:z) #:x #:y)
(let ([c% (class object% (super-new))])
(test-flat-contract (subclass?/c c%) c% object%)
@ -3969,7 +3971,8 @@
(test-name 'natural-number/c natural-number/c)
(test-name 'false/c false/c)
(test-name 'printable/c printable/c)
(test-name '(symbols 'a 'b 'c)(symbols 'a 'b 'c))
(test-name '(symbols 'a 'b 'c) (symbols 'a 'b 'c))
(test-name '(one-of/c 1 2 3) (one-of/c 1 2 3))
(let ([c% (class object% (super-new))])
(test-name '(subclass?/c class:c%) (subclass?/c c%)))
@ -4112,6 +4115,12 @@
(test #t contract-stronger? number? number?)
(test #f contract-stronger? boolean? number?)
(test #t contract-stronger? (symbols 'x 'y) (symbols 'x 'y 'z))
(test #f contract-stronger? (symbols 'x 'y 'z) (symbols 'x 'y))
(test #t contract-stronger? (symbols 'x 'y) (symbols 'z 'x 'y))
(test #f contract-stronger? (symbols 'z 'x 'y) (symbols 'x 'y))
(test #t contract-stronger? (one-of/c (expt 2 100)) (one-of/c (expt 2 100) 12))
(let ()
(define-contract-struct couple (hd tl))
(define (non-zero? x) (not (zero? x)))