Removed installed-teachpack reference from map-image test suite. Added to rotating-triangle test case.

This commit is contained in:
Stephen Bloch 2010-12-30 11:00:44 -05:00
parent f13883194d
commit 8e655dee8e
3 changed files with 19 additions and 12 deletions

View File

@ -0,0 +1,2 @@
tests
*.css

View File

@ -1,7 +1,7 @@
;; The first three lines of this file were inserted by DrRacket. They record metadata
;; about the language level of this file in a form that our tools can easily process.
#reader(lib "htdp-beginner-reader.ss" "lang")((modname map-image-bsl-tests) (read-case-sensitive #t) (teachpacks ((lib "picturing-programs.rkt" "installed-teachpacks"))) (htdp-settings #(#t constructor repeating-decimal #f #t none #f ((lib "picturing-programs.rkt" "installed-teachpacks")))))
#reader(lib "htdp-beginner-reader.ss" "lang")((modname map-image-bsl-tests) (read-case-sensitive #t) (teachpacks ()) (htdp-settings #(#t constructor repeating-decimal #f #t none #f ())))
(require picturing-programs)
; Test cases for primitives:
(check-expect (real->int 3.2) 3)

View File

@ -10,22 +10,27 @@
(define tricirc (overlay/xy TRI
(- (/ SIDE 2) R) 0
CIRC))
(define badtricirc
(overlay/align "middle" "middle"
TRI
CIRC))
(define (rotate-1 pic)
(rotate 1 pic))
"Triangle rotating by itself (with its top and left attached to the top and left of the window):"
(big-bang TRI
(on-tick rotate-1 .05)
(check-with image?)
(on-draw show-it))
"Triangle rotating around its center:"
(big-bang tricirc
(on-tick rotate-1 .05)
(check-with image?)
(on-draw show-it))
"Triangle rotating around the center of its bounding box:"
(big-bang badtricirc
(on-tick rotate-1 .05)
(check-with image?)
(on-draw show-it))
;show-on-yellow : image -> image
(define (show-on-yellow pic)
(overlay pic (rectangle (* 2 R) (* 2 R) "solid" "yellow")))
"Triangle rotating around its center, on a yellow background:"
(big-bang tricirc
(on-tick rotate-1 .05)
(check-with image?)
(on-draw show-on-yellow))