diff --git a/collects/2htdp/private/world.rkt b/collects/2htdp/private/world.rkt index 24046f2d06..92638e1347 100644 --- a/collects/2htdp/private/world.rkt +++ b/collects/2htdp/private/world.rkt @@ -390,7 +390,7 @@ ;; -> String or false (define/private (recordable-directory) - (and (string? record?) (directory-exists? record?) record?)) + (and (path-string? record?) (directory-exists? record?) record?)) ;; Frame Custodian ->* (-> Void) (-> Void) ;; adds the stop animation and image creation button, diff --git a/collects/2htdp/tests/record-stop-when.rkt b/collects/2htdp/tests/record-stop-when.rkt index 130cfa30b5..21dd9466d7 100644 --- a/collects/2htdp/tests/record-stop-when.rkt +++ b/collects/2htdp/tests/record-stop-when.rkt @@ -1,6 +1,7 @@ #lang racket -(require 2htdp/universe 2htdp/image (only-in lang/imageeq image=?)) +(require 2htdp/universe 2htdp/image (only-in lang/imageeq image=?) + racket/runtime-path) (define (draw-number n) (place-image (text (number->string n) 44 'red) 50 50 (empty-scene 100 100))) @@ -9,13 +10,12 @@ (place-image stop 50 50 (empty-scene 100 100))) (define stop (text "STOP" 44 'red)) - -(define dir "images0") +(define-runtime-path dir "images0") (unless (directory-exists? dir) (make-directory dir)) (parameterize ([current-directory dir]) (for-each delete-file (directory-list))) -(with-output-to-file (format "./~a/index.html" dir) +(with-output-to-file (build-path dir "index.html") (lambda () (displayln "")) #:exists 'replace) @@ -31,6 +31,5 @@ (define j (draw-stop 5)) (unless (image=? (crop 0 0 100 100 i) j) - (fprintf (current-error-port) - "this test needs to be revised -- the way 'world' writes images adds an extra pixel -- think! \n")) + (eprintf "this test needs to be revised -- the way 'world' writes images adds an extra pixel -- think! \n"))