Changeset 14852 in project


Ignore:
Timestamp:
06/01/09 13:23:48 (10 years ago)
Author:
sjamaan
Message:

Add small bugfixes

Location:
release/3/fancypants
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • release/3/fancypants/fancypants.scm

    r13976 r14852  
    169169                          ((single-close)
    170170                           (when (and (fifth parts) (> single-open-count 0))
    171                                (set! single-open-count (add1 single-open-count)))
     171                               (set! single-open-count (sub1 single-open-count)))
    172172                           '(& "#x2019"))
    173173                          ((double-open)
     
    177177                          ((double-close)
    178178                           (when (and (fifth parts) (> double-open-count 0))
    179                                (set! single-open-count (add1 double-open-count)))
     179                               (set! double-open-count (sub1 double-open-count)))
    180180                           '(& "#x201d"))
    181181                          ;; For the balanced ones, close it if it was open,
  • release/3/fancypants/tests/run.scm

    r13977 r14852  
    1919          (fancify "Does <-> look like a space ship?" default-arrow-map))))
    2020
     21;; FIXME: The distribution of *flatten* and empty strings is too
     22;; dependent on the algorithm that is being used.
    2123(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  (test '(p (*flatten* "Fatboy Slim is the band of the " (& "#x2019") "90s" "!"))
     25        (smarten-quotes '(p "Fatboy Slim is the band of the '90s!")))
    2426  (test '(p (*flatten* "What" (& "#x2019") "s" " that?"))
    2527        (smarten-quotes '(p "What's that?")))
    2628  (test '(p (*flatten* "" (& "#x201c") "" "We" (& "#x2019") "re" " going to need a bigger boat" (& "#x201d") "" ", he said"))
    2729        (smarten-quotes '(p "\"We're going to need a bigger boat\", he said")))
     30  (test '(p (*flatten* "" (& "#x2018") "" "We" (& "#x2019") "re" " going to need a bigger boat" (& "#x2019") "" ", he said"))
     31        (smarten-quotes '(p "'We're going to need a bigger boat', he said")))
     32  (test '(p (*flatten* "" (& "#x2018") "" "One" (& "#x2019") "" " or " (& "#x2018") "" "Two" (& "#x2019") "" "?"))
     33        (smarten-quotes '(p "'One' or 'Two'?")))
     34  (test '(p (*flatten* "" (& "#x201c") "" "One" (& "#x201d") "" " or " (& "#x201c") "" "Two" (& "#x201d") "" "?"))
     35        (smarten-quotes '(p "\"One\" or \"Two\"?")))
    2836  (test '(p (*flatten* "" (& "#x201c") "" "There" (& "#x2019") "s" " ") (em (*flatten* "no")) (*flatten* " business like show business" (& "#x201d") "" ""))
    2937        (smarten-quotes
     
    3240        (smarten-quotes '(p "``Hi there'', he said")))
    3341  (test '(p (*flatten* "" (& "#x201c") "" "" (& "#x201c") "" "Hi there" (& "#x201d") "" ", he said" (& "#x201d") "" ", I said"))
    34         (smarten-quotes '(p "````Hi there'', he said'', I said"))))
     42        (smarten-quotes '(p "````Hi there'', he said'', I said")))
     43  (test '(p (*flatten* "" (& "#x201c") "" "" (& "#x201c") "" "Hi there" (& "#x201d") "" ", he said" (& "#x201d") "" ", I said"))
     44        (smarten-quotes '(p "\"``Hi there'', he said\", I said")))
     45  )
    3546
    3647(test-group "sxml rulesets"
Note: See TracChangeset for help on using the changeset viewer.