From e9a4d3aeb2c912ecec699f9163e7d71367d0972d Mon Sep 17 00:00:00 2001
From: Matthias Felleisen
Date: Tue, 26 Jun 2007 13:10:42 +0000
Subject: [PATCH] 8773: I should have run the tests
svn: r6741
---
collects/htdp/Test/convert.ss | 1 +
collects/htdp/Test/dir.ss | 5 ++++-
collects/htdp/Test/draw.ss | 3 +++
collects/htdp/Test/world.ss | 2 +-
collects/htdp/elevator.ss | 2 +-
collects/htdp/graphing.ss | 2 +-
collects/htdp/world.ss | 18 ++++++++++++------
collects/teachpack/htdp/Docs/world.thtml | 3 ++-
8 files changed, 25 insertions(+), 11 deletions(-)
diff --git a/collects/htdp/Test/convert.ss b/collects/htdp/Test/convert.ss
index 44dce8761b..480825686b 100644
--- a/collects/htdp/Test/convert.ss
+++ b/collects/htdp/Test/convert.ss
@@ -1,5 +1,6 @@
;; test errors by hand in GUI
(load "tester.ss")
+(require (lib "convert.ss" "htdp"))
;; f2c : num -> num
;; to convert a Fahrenheit temperature into a Celsius temperature
diff --git a/collects/htdp/Test/dir.ss b/collects/htdp/Test/dir.ss
index 2841a1eb4e..b25fe524d7 100644
--- a/collects/htdp/Test/dir.ss
+++ b/collects/htdp/Test/dir.ss
@@ -1,8 +1,11 @@
+;; The first three lines of this file were inserted by DrScheme. They record metadata
+;; about the language level of this file in a form that our tools can easily process.
+#reader(lib "htdp-intermediate-lambda-reader.ss" "lang")((modname dir) (read-case-sensitive #t) (teachpacks ((lib "dir.ss" "teachpack" "htdp"))) (htdp-settings #8(#t constructor repeating-decimal #f #t none #f ((lib "dir.ss" "teachpack" "htdp")))))
;; TeachPack: dir.ss
;; Language: Intermediate with Lambda
(define current (create-dir "."))
-(define teachps (create-dir (string-append "/Users/matthias/plt/" "/teachpack/htdp")))
+(define teachps (create-dir (string-append "/Users/matthias/plt/" "collects/teachpack/htdp")))
(define current-files (map file-name (dir-files current)))
(define teachps-files (map file-name (dir-files teachps)))
diff --git a/collects/htdp/Test/draw.ss b/collects/htdp/Test/draw.ss
index ab8966e3b4..6e0b67b24b 100644
--- a/collects/htdp/Test/draw.ss
+++ b/collects/htdp/Test/draw.ss
@@ -1,3 +1,6 @@
+;; The first three lines of this file were inserted by DrScheme. They record metadata
+;; about the language level of this file in a form that our tools can easily process.
+#reader(lib "htdp-intermediate-lambda-reader.ss" "lang")((modname draw) (read-case-sensitive #t) (teachpacks ((lib "draw.ss" "teachpack" "htdp"))) (htdp-settings #8(#t constructor repeating-decimal #f #t none #f ((lib "draw.ss" "teachpack" "htdp")))))
;; This tests a good portion but needs some more
;; This needs some tests for error behavior of functions ...
diff --git a/collects/htdp/Test/world.ss b/collects/htdp/Test/world.ss
index 3789a1e951..fd7e4445a7 100644
--- a/collects/htdp/Test/world.ss
+++ b/collects/htdp/Test/world.ss
@@ -1,6 +1,6 @@
;; The first three lines of this file were inserted by DrScheme. They record metadata
;; about the language level of this file in a form that our tools can easily process.
-#reader(lib "htdp-intermediate-lambda-reader.ss" "lang")((modname world) (read-case-sensitive #t) (htdp-settings #7(#t constructor repeating-decimal #f #t none #f)))
+#reader(lib "htdp-intermediate-lambda-reader.ss" "lang")((modname world) (read-case-sensitive #t) (teachpacks ((lib "world.ss" "teachpack" "htdp"))) (htdp-settings #8(#t constructor repeating-decimal #f #t none #f ((lib "world.ss" "teachpack" "htdp")))))
;; testing world
;; World = Nat
diff --git a/collects/htdp/elevator.ss b/collects/htdp/elevator.ss
index ed9524f15e..336d93afeb 100644
--- a/collects/htdp/elevator.ss
+++ b/collects/htdp/elevator.ss
@@ -1,4 +1,4 @@
-#cs(module elevator mzscheme
+(module elevator mzscheme
(require (lib "big-draw.ss" "htdp")
(lib "error.ss" "htdp")
(lib "posn.ss" "lang")
diff --git a/collects/htdp/graphing.ss b/collects/htdp/graphing.ss
index e3cf7482ae..51dd430b0e 100644
--- a/collects/htdp/graphing.ss
+++ b/collects/htdp/graphing.ss
@@ -1,4 +1,4 @@
-#cs(module graphing mzscheme
+(module graphing mzscheme
(require (lib "error.ss" "htdp")
(lib "unit.ss")
(lib "draw-sig.ss" "htdp")
diff --git a/collects/htdp/world.ss b/collects/htdp/world.ss
index 045aa5a71b..e61d539a1c 100644
--- a/collects/htdp/world.ss
+++ b/collects/htdp/world.ss
@@ -282,12 +282,18 @@ Matthew
(for-each (lambda (cand)
(check-image 'run-movie cand "first" "list of images"))
movie)
- (let run-movie ([movie movie])
- (cond [(null? movie) #t]
- [(pair? movie)
- (update-frame (car movie))
- (sleep/yield .05)
- (run-movie (cdr movie))])))
+ (let* ([fst (car movie)]
+ [wdt (image-width fst)]
+ [hgt (image-height fst)]
+ [nxt (lambda (w) (if (null? w) (end-of-time "") (cdr w)))])
+ (big-bang wdt hgt (/ 1 27) movie)
+ (let run-movie ([movie movie])
+ (cond
+ [(null? movie) #t]
+ [(pair? movie)
+ (update-frame (car movie))
+ (sleep/yield .05)
+ (run-movie (cdr movie))]))))
(define (run-simulation width height rate f)
(check-pos 'run-simulation width "first")
diff --git a/collects/teachpack/htdp/Docs/world.thtml b/collects/teachpack/htdp/Docs/world.thtml
index a2dbcff825..47c5a83c46 100644
--- a/collects/teachpack/htdp/Docs/world.thtml
+++ b/collects/teachpack/htdp/Docs/world.thtml
@@ -135,7 +135,8 @@ students to simulate a small world of animated drawings and games:
{(idx run-movie)} : (Listof Image) -> true
(run-movie loi)
- shows the list of images in loi, time-delayed
+ shows the list of images in loi in a time-delayed manner;
+ assume: all images are of the same size