Removed installed-teachpack reference from map-image test suite. Added to rotating-triangle test case.
This commit is contained in:
parent
f13883194d
commit
8e655dee8e
2
collects/picturing-programs/.gitignore
vendored
Normal file
2
collects/picturing-programs/.gitignore
vendored
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
tests
|
||||||
|
*.css
|
|
@ -1,7 +1,7 @@
|
||||||
;; The first three lines of this file were inserted by DrRacket. They record metadata
|
;; 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.
|
;; 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:
|
; Test cases for primitives:
|
||||||
(check-expect (real->int 3.2) 3)
|
(check-expect (real->int 3.2) 3)
|
||||||
|
|
|
@ -10,22 +10,27 @@
|
||||||
(define tricirc (overlay/xy TRI
|
(define tricirc (overlay/xy TRI
|
||||||
(- (/ SIDE 2) R) 0
|
(- (/ SIDE 2) R) 0
|
||||||
CIRC))
|
CIRC))
|
||||||
(define badtricirc
|
|
||||||
(overlay/align "middle" "middle"
|
|
||||||
TRI
|
|
||||||
CIRC))
|
|
||||||
|
|
||||||
(define (rotate-1 pic)
|
(define (rotate-1 pic)
|
||||||
(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:"
|
"Triangle rotating around its center:"
|
||||||
(big-bang tricirc
|
(big-bang tricirc
|
||||||
(on-tick rotate-1 .05)
|
(on-tick rotate-1 .05)
|
||||||
(check-with image?)
|
(check-with image?)
|
||||||
(on-draw show-it))
|
(on-draw show-it))
|
||||||
|
|
||||||
"Triangle rotating around the center of its bounding box:"
|
;show-on-yellow : image -> image
|
||||||
(big-bang badtricirc
|
(define (show-on-yellow pic)
|
||||||
(on-tick rotate-1 .05)
|
(overlay pic (rectangle (* 2 R) (* 2 R) "solid" "yellow")))
|
||||||
(check-with image?)
|
|
||||||
(on-draw show-it))
|
"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))
|
||||||
|
|
Loading…
Reference in New Issue
Block a user