fix load-handler test for Racket CS
This commit is contained in:
parent
7067ac8bfa
commit
6b09e4f4dd
|
@ -29,8 +29,13 @@
|
||||||
(define b 'b)
|
(define b 'b)
|
||||||
(provide b))))))
|
(provide b))))))
|
||||||
|
|
||||||
(when (directory-exists? (build-path tmp-dir "compiled"))
|
(define compiled-dir (let ([l (use-compiled-file-paths)])
|
||||||
(delete-directory/files (build-path tmp-dir "compiled")))
|
(if (pair? l)
|
||||||
|
(car l)
|
||||||
|
"compiled")))
|
||||||
|
|
||||||
|
(when (directory-exists? (build-path tmp-dir compiled-dir))
|
||||||
|
(delete-directory/files (build-path tmp-dir compiled-dir)))
|
||||||
|
|
||||||
(define (do-test a b where)
|
(define (do-test a b where)
|
||||||
(unless (equal? a b)
|
(unless (equal? a b)
|
||||||
|
@ -75,7 +80,7 @@
|
||||||
;; eval compiled code directly:
|
;; eval compiled code directly:
|
||||||
(parameterize ([current-module-declare-name (make-resolved-module-path (build-path tmp-dir tmp-file-name))]
|
(parameterize ([current-module-declare-name (make-resolved-module-path (build-path tmp-dir tmp-file-name))]
|
||||||
[read-accept-compiled #t])
|
[read-accept-compiled #t])
|
||||||
(with-input-from-file (build-path tmp-dir "compiled" (path-add-suffix tmp-file-name #".zo"))
|
(with-input-from-file (build-path tmp-dir compiled-dir (path-add-suffix tmp-file-name #".zo"))
|
||||||
(lambda () (eval (read)))))
|
(lambda () (eval (read)))))
|
||||||
;; It's as if we read from source:
|
;; It's as if we read from source:
|
||||||
(test 'm (dynamic-require tmp-file 'm))
|
(test 'm (dynamic-require tmp-file 'm))
|
||||||
|
|
Loading…
Reference in New Issue
Block a user