move some test-generated files to temp dir
This commit is contained in:
parent
1c9db0d07c
commit
ad34e983f2
|
@ -7,9 +7,11 @@
|
|||
|
||||
(define (Fahrenheit->Celsius x) (* (/ 100 180) (- x 32)))
|
||||
|
||||
(convert-file non-error-pth Fahrenheit->Celsius "out.dat")
|
||||
(convert-file non-error-pth Fahrenheit->Celsius
|
||||
(build-path (find-system-path 'temp-dir) "out.dat"))
|
||||
|
||||
(with-handlers ((exn:fail:read? void))
|
||||
"The input file contains a bad header. The next line should raise an exn."
|
||||
(convert-file error-pth Fahrenheit->Celsius "out.dat")
|
||||
(convert-file error-pth Fahrenheit->Celsius
|
||||
(build-path (find-system-path 'temp-dir) "out.dat"))
|
||||
(raise `(test "this test should have failed but didn't")))
|
||||
|
|
|
@ -18,8 +18,8 @@
|
|||
(= (f2c -40) -40)
|
||||
|
||||
;; ----------------------------------------------------------------------------
|
||||
(define IN "convert-in.dat")
|
||||
(define OUT "convert-out.dat")
|
||||
(define IN (build-path (find-system-path 'temp-dir) "convert-in.dat"))
|
||||
(define OUT (build-path (find-system-path 'temp-dir) "convert-out.dat"))
|
||||
|
||||
(define (create-convert-in)
|
||||
(printf "212 32\n-40\n"))
|
||||
|
|
|
@ -10,10 +10,10 @@
|
|||
(require srfi/42)
|
||||
|
||||
(define (my-open-output-file filename)
|
||||
(open-output-file filename 'replace 'text) )
|
||||
(open-output-file (build-path (find-system-path 'temp-dir) filename) 'replace 'text) )
|
||||
|
||||
(define (my-call-with-input-file filename thunk)
|
||||
(call-with-input-file filename thunk 'text) )
|
||||
(call-with-input-file (build-path (find-system-path 'temp-dir) filename) thunk 'text) )
|
||||
|
||||
; examples.scm starts here -------------------------------------------------
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#lang racket
|
||||
|
||||
(define here (current-directory))
|
||||
(define here (find-system-path 'temp-dir))
|
||||
(define txt (build-path here "some.txt"))
|
||||
|
||||
(with-output-to-file txt
|
||||
|
@ -11,7 +11,7 @@ Here is some text that looks at @this
|
|||
END
|
||||
)))
|
||||
|
||||
(with-output-to-file "relative.rkt"
|
||||
(with-output-to-file (build-path here "relative.rkt")
|
||||
#:exists 'replace
|
||||
(lambda ()
|
||||
(display #<<END
|
||||
|
@ -24,7 +24,7 @@ END
|
|||
END
|
||||
)))
|
||||
|
||||
(with-output-to-file "absolute.rkt"
|
||||
(with-output-to-file (build-path here "absolute.rkt")
|
||||
#:exists 'replace
|
||||
(lambda ()
|
||||
(display #<<END
|
||||
|
@ -45,11 +45,12 @@ END
|
|||
)))
|
||||
|
||||
(require tests/eli-tester)
|
||||
(parameterize ([current-directory here])
|
||||
(define rel (dynamic-require "relative.rkt" 'ans))
|
||||
(define abs (dynamic-require "absolute.rkt" 'ans))
|
||||
(test
|
||||
rel => abs
|
||||
rel => "Here is some text that looks at 5")
|
||||
rel => "Here is some text that looks at 5"))
|
||||
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user