From 186111b5caf49984f3f52779554fbd46c1187c7d Mon Sep 17 00:00:00 2001 From: Matthew Butterick Date: Tue, 11 Oct 2016 16:04:36 -0700 Subject: [PATCH] adjust tests so they don't leave detritus --- pollen/private/ts.rktd | 2 +- pollen/test/data/quick-tour/uptown/pollen.rkt | 5 +++++ pollen/test/pollen.rkt | 8 ++++++++ pollen/test/test-pathup.rkt | 5 +++-- pollen/test/test-quick-tour.rkt | 7 +------ 5 files changed, 18 insertions(+), 9 deletions(-) create mode 100644 pollen/test/pollen.rkt diff --git a/pollen/private/ts.rktd b/pollen/private/ts.rktd index be567b7..90f38e8 100644 --- a/pollen/private/ts.rktd +++ b/pollen/private/ts.rktd @@ -1 +1 @@ -1476035093 +1476227076 diff --git a/pollen/test/data/quick-tour/uptown/pollen.rkt b/pollen/test/data/quick-tour/uptown/pollen.rkt index 5e7a754..abfcc47 100644 --- a/pollen/test/data/quick-tour/uptown/pollen.rkt +++ b/pollen/test/data/quick-tour/uptown/pollen.rkt @@ -6,3 +6,8 @@ (define items (make-default-tag-function 'ul)) (define item (make-default-tag-function 'li 'p)) (define (link url text) `(a [[href ,url]] ,text)) + +(module setup racket/base + (provide (all-defined-out)) + (define compile-cache-active #f) + (define render-cache-active #f)) diff --git a/pollen/test/pollen.rkt b/pollen/test/pollen.rkt new file mode 100644 index 0000000..0181b8e --- /dev/null +++ b/pollen/test/pollen.rkt @@ -0,0 +1,8 @@ +#lang racket/base + +;; This will prevent tests from littering their directory +;; with pollen-cache files. +(module setup racket/base + (provide (all-defined-out)) + (define compile-cache-active #f) + (define render-cache-active #f)) \ No newline at end of file diff --git a/pollen/test/test-pathup.rkt b/pollen/test/test-pathup.rkt index 4f6fa19..5814c55 100644 --- a/pollen/test/test-pathup.rkt +++ b/pollen/test/test-pathup.rkt @@ -9,8 +9,9 @@ (define-runtime-path cache-dir "data/pathup/subdir/pollen-cache") (define-runtime-path other-cache-dir "data/pathup/subdir/subdir/pollen-cache") - -(check-false (get-directory-require-files "test-pathup.rkt")) +(define-runtime-path up-pollen "pollen.rkt") + +(check-equal? (get-directory-require-files "test-pathup.rkt") (list up-pollen)) (check-equal? (get-directory-require-files pathup-one) (list dr-top)) (check-equal? (get-directory-require-files pathup-two) (list dr-sub)) (check-equal? (get-template-for pathup-one) template) diff --git a/pollen/test/test-quick-tour.rkt b/pollen/test/test-quick-tour.rkt index 215e983..1491a97 100644 --- a/pollen/test/test-quick-tour.rkt +++ b/pollen/test/test-quick-tour.rkt @@ -13,10 +13,6 @@ (define-runtime-path downtown.html "data/quick-tour/downtown/downtown.html") (define-runtime-path uptown.html "data/quick-tour/uptown/uptown.html") -(define-runtime-path pollen-cache "data/quick-tour/pollen-cache") -(define-runtime-path pollen-cache-uptown "data/quick-tour/uptown/pollen-cache") -(define-runtime-path pollen-cache-downtown "data/quick-tour/downtown/pollen-cache") - ;; test makes sure that quick tour files work (parameterize ([current-output-port (open-output-string)] [current-directory quick-tour-dir] @@ -30,5 +26,4 @@ (check-true (file-exists? downtown.html)) (check-true (file-exists? uptown.html))) -(for-each delete-file (list hello.txt margin.html downtown.html uptown.html)) -(for-each delete-directory/files (list pollen-cache pollen-cache-uptown pollen-cache-downtown)) \ No newline at end of file +(for-each delete-file (list hello.txt margin.html downtown.html uptown.html)) \ No newline at end of file