tests for quick-tour examples; turn off cache-fetching messages

pull/84/head
Matthew Butterick 9 years ago
parent da4c6cf1b3
commit 19ed03dbc3

@ -90,7 +90,6 @@
key key
cache-dir cache-dir
(λ _ (λ _
(message (format "caching: ~a from ~a" subkey (find-relative-path (current-directory) path)))
(write-to-file (path->hash path subkey) dest-file #:exists 'replace)) (write-to-file (path->hash path subkey) dest-file #:exists 'replace))
#:max-cache-size (world:current-compile-cache-max-size)) #:max-cache-size (world:current-compile-cache-max-size))
(file->value dest-file))) subkey)] (file->value dest-file))) subkey)]

@ -0,0 +1,9 @@
#lang pollen
◊define[metal]{Plutonium}
Pollen + ◊metal
---------------
+ You **wanted** ◊metal — you _got_ it.
+ [search for ◊metal](https://google.com/search?q=◊metal)

@ -0,0 +1,8 @@
<html><head><meta charset="UTF-8"/></head>
<body style="background: #f6f6f6">
<div style="background: white; margin: 3em;
border:10px double gray; padding: 3em; font-size: 130%;">
This file is ◊here
<hr />
◊->html{◊doc}
</div></body></html>

@ -0,0 +1,4 @@
#lang pollen
Mean Street
Panama
Hear About It Later

@ -0,0 +1,5 @@
#lang pollen
define[my-inset]{30%}
<body style="margin: ◊my-inset; border:1px solid black">
my-inset is the inset.
</body>

@ -0,0 +1,8 @@
#lang racket/base
(require pollen/tag)
(provide (all-defined-out))
(define headline (make-default-tag-function 'h2))
(define items (make-default-tag-function 'ul))
(define item (make-default-tag-function 'li 'p))
(define (link url text) `(a [[href ,url]] ,text))

@ -0,0 +1,8 @@
<html><head><meta charset="UTF-8"/></head>
<body style="background: #f6f6f6">
<div style="background: white; margin: 3em;
border:10px double gray; padding: 3em; font-size: 130%;">
This file is ◊here
<hr />
◊->html{◊doc}
</div></body></html>

@ -0,0 +1,8 @@
#lang pollen
headline{Pollen markup}
items{
item{You strong{wanted} it you em{got} it.}
item{link["https://google.com/search?q=racket"]{search for Racket}}
}

@ -0,0 +1,34 @@
#lang at-exp racket/base
(require rackunit racket/runtime-path pollen/render racket/file pollen/world)
;; define-runtime-path only allowed at top level
(define-runtime-path quick-tour-dir "data/quick-tour/")
(define-runtime-path hello.txt.pp "data/quick-tour/hello.txt.pp")
(define-runtime-path margin.html.pp "data/quick-tour/margin.html.pp")
(define-runtime-path downtown.html.pmd "data/quick-tour/downtown/downtown.html.pmd")
(define-runtime-path uptown.html.pm "data/quick-tour/uptown/uptown.html.pm")
(define-runtime-path hello.txt "data/quick-tour/hello.txt")
(define-runtime-path margin.html "data/quick-tour/margin.html")
(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]
[world:current-project-root quick-tour-dir])
(check-not-exn (λ _ (render-to-file-if-needed hello.txt.pp)))
(check-not-exn (λ _ (render-to-file-if-needed margin.html.pp)))
(check-not-exn (λ _ (render-to-file-if-needed downtown.html.pmd)))
(check-not-exn (λ _ (render-to-file-if-needed uptown.html.pm)))
(check-true (file-exists? hello.txt))
(check-true (file-exists? margin.html))
(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))
Loading…
Cancel
Save