source: project/release/3/fancypants/tests/run.scm @ 13974

Last change on this file since 13974 was 13974, checked in by sjamaan, 11 years ago

Add a testsuite and update to 0.2

File size: 2.0 KB
Line 
1(require-extension syntax-case test sxml-transforms)
2
3(load "../fancypants.scm")
4
5(test-group "fancification"
6  (test-group "ligatures"
7    (test '("Delicious wa" (& "#xfb04") "es")
8          (fancify "Delicious waffles" default-ligature-map))
9    (test '("Ye olde bu" (& "#xfb00") " coat")
10          (fancify "Ye olde buff coat" default-ligature-map))
11    (test '("Can you " (& "#xfb02") "y away?")
12          (fancify "Can you fly away?" default-ligature-map))
13    (test '("Fly, you fools!")
14          (fancify "Fly, you fools!" default-ligature-map)))
15  (test-group "arrows"
16    (test '("number" (& "#x2192") "string")
17          (fancify "number->string" default-arrow-map))
18    (test '("Does " (& "#x2194") " look like a space ship?")
19          (fancify "Does <-> look like a space ship?" default-arrow-map))))
20
21(test-group "quote education"
22  (test '(p (*flatten* "Fatboy Slim is the band of the 90" (& "#x2019") "s" "!"))
23        (smarten-quotes '(p "Fatboy Slim is the band of the 90's!")
24                        all-quotes default-exceptions))
25  (test '(p (*flatten* "What" (& "#x2019") "s" " that?"))
26        (smarten-quotes '(p "What's that?") all-quotes default-exceptions))
27  (test '(p (*flatten* "" (& "#x201c") "" "We" (& "#x2019") "re" " going to need a bigger boat" (& "#x201d") "" ", he said"))
28        (smarten-quotes '(p "\"We're going to need a bigger boat\", he said")
29                        all-quotes default-exceptions))
30  (test '(p (*flatten* "" (& "#x201c") "" "There" (& "#x2019") "s" " ") (em (*flatten* "no")) (*flatten* " business like show business" (& "#x201d") "" ""))
31        (smarten-quotes
32         '(p "\"There's " (em "no") " business like show business\"")
33         all-quotes default-exceptions)))
34
35(test-group "sxml rulesets"
36  (test '(p "The procedure " (& "#x201c") "number" (& "#x2192") "string" (& "#x201d") " changes numbers into strings")
37        (pre-post-order
38         (pre-post-order
39          '(p "The procedure \"number->string\" changes numbers into strings")
40          (make-smart-quote-rules))
41         (make-fancy-rules))))
Note: See TracBrowser for help on using the repository browser.