diff --git a/collects/picturing-programs/.gitignore b/collects/picturing-programs/.gitignore new file mode 100644 index 0000000000..ddac1c582f --- /dev/null +++ b/collects/picturing-programs/.gitignore @@ -0,0 +1,2 @@ +tests +*.css diff --git a/collects/picturing-programs/tests/map-image-bsl-tests.rkt b/collects/picturing-programs/tests/map-image-bsl-tests.rkt index 1b65f2a3a3..a234482c1d 100755 --- a/collects/picturing-programs/tests/map-image-bsl-tests.rkt +++ b/collects/picturing-programs/tests/map-image-bsl-tests.rkt @@ -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) diff --git a/collects/picturing-programs/tests/rotating-triangle.rkt b/collects/picturing-programs/tests/rotating-triangle.rkt index de11bf2a42..bf3a98b142 100644 --- a/collects/picturing-programs/tests/rotating-triangle.rkt +++ b/collects/picturing-programs/tests/rotating-triangle.rkt @@ -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))