racket/collects/scribblings/guide/contracts-examples/3-test.ss
Eli Barzilay db62afaadc set svn:eol-style
svn: r8875
2008-03-04 17:28:15 +00:00

15 lines
430 B
Scheme

#lang scheme
(require (planet "test.ss" ("schematics" "schemeunit.plt" 2))
(planet "text-ui.ss" ("schematics" "schemeunit.plt" 2))
"3.ss")
(define d0 (initialize (flat-contract integer?) =))
(define d (put (put (put d0 'a 2) 'b 2) 'c 1))
(test/text-ui
(test-suite
"dictionaries"
(test-equal? "value for" 2 (value-for d 'b))
(test-false "has?" (has? (rem d 'b) 'b))
(test-equal? "count" 3 (count d))))