Changeset 267

Show
Ignore:
Timestamp:
03/15/2008 06:38:32 (8 months ago)
Author:
jgarber
Message:

Split testing of different formatters into different test cases.

Location:
branches/superredcloth/test
Files:
1 added
15 modified

Legend:

Unmodified
Added
Removed
  • branches/superredcloth/test/code.yml

    r265 r267  
    22name: inline code 
    33in: 'This is an empty dictionary: @{}@' 
    4 out: '<p>This is an empty dictionary: <code>{}</code></p>' 
     4html: '<p>This is an empty dictionary: <code>{}</code></p>' 
    55--- 
    66name: inline code escapement 
    77in: 'Please type @cat "file.txt" > otherfile.txt@ at the prompt.' 
    8 out: '<p>Please type <code>cat "file.txt" &gt; otherfile.txt</code> at the prompt.</p>' 
     8html: '<p>Please type <code>cat "file.txt" &gt; otherfile.txt</code> at the prompt.</p>' 
    99--- 
    1010name: escaping in blockcode 
    1111in: 'bc. This is within a block of code, so < and > should be entities.  You can talk about a <p class="foo"> tag if you wish and it will be properly escaped.' 
    12 out: '<pre><code>This is within a block of code, so &lt; and &gt; should be entities.  You can talk about a &lt;p class="foo"&gt; tag if you wish and it will be properly escaped.</code></pre>' 
     12html: '<pre><code>This is within a block of code, so &lt; and &gt; should be entities.  You can talk about a &lt;p class="foo"&gt; tag if you wish and it will be properly escaped.</code></pre>' 
    1313--- 
    1414name: escaping in pre 
    1515in: '<pre><code>This is within a block of code, so < and > should be entities.  You can talk about a <p class="foo"> tag in pre tags too.</code></pre>' 
    16 out: '<pre><code>This is within a block of code, so &lt; and &gt; should be entities.  You can talk about a &lt;p class="foo"&gt; tag in pre tags too.</code></pre>' 
     16html: '<pre><code>This is within a block of code, so &lt; and &gt; should be entities.  You can talk about a &lt;p class="foo"&gt; tag in pre tags too.</code></pre>' 
    1717--- 
    1818name: escaping in normal text 
    1919in: |- 
    2020  This is a regular paragraph.  AT&T. &pound;38 > $38. 
    21 out: |- 
     21html: |- 
    2222  <p>This is a regular paragraph.  AT&amp;T. &pound;38 &gt; $38.</p> 
    2323--- 
     
    2525in: "Math fact: 3 &lt; 5 &amp; 5 &gt; 3 but &pound;6 &#62; $6. 
    2626" 
    27 out: "<p>Math fact: 3 &lt; 5 &amp; 5 &gt; 3 but &pound;6 &#62; $6.</p>" 
     27html: "<p>Math fact: 3 &lt; 5 &amp; 5 &gt; 3 but &pound;6 &#62; $6.</p>" 
    2828--- 
    2929name: escaping of existing entities in blockcode 
    3030in: "bc. Math fact: 3 &lt; 5 &amp; 5 &gt; 3 but &pound;5 &#62; $5. 
    3131" 
    32 out: "<pre><code>Math fact: 3 &amp;lt; 5 &amp;amp; 5 &amp;gt; 3 but &amp;pound;5 &amp;#62; $5.</code></pre>" 
     32html: "<pre><code>Math fact: 3 &amp;lt; 5 &amp;amp; 5 &amp;gt; 3 but &amp;pound;5 &amp;#62; $5.</code></pre>" 
    3333--- 
    3434name: nested pre tags 
     
    4545  </code> 
    4646  </pre> 
    47 out: |-   
     47html: |-   
    4848  <pre> 
    4949  <code> 
     
    6767  </code> 
    6868  </pre> 
    69 out: |- 
     69html: |- 
    7070  <pre> 
    7171  <code> 
     
    7979in: |- 
    8080  bc. __not italics__ 
    81 out: |- 
     81html: |- 
    8282  <pre><code>__not italics__</code></pre> 
    8383--- 
     
    8989 
    9090  p. Back to normal. 
    91 out: |- 
     91html: |- 
    9292  <p>Regular paragraph</p> 
    9393  <p>Escaped portion -- will not be formatted by Textile at all</p> 
     
    9999  # *test* 
    100100  </notextile> 
    101 out: |- 
     101html: |- 
    102102   
    103103  # *test* 
     
    109109  * and @x@ is also. 
    110110 
    111 out: |- 
     111html: |- 
    112112  <ul> 
    113113        <li><code>foo</code></li> 
     
    126126 
    127127  p. And then go back with a normal paragraph. 
    128 out: |- 
     128html: |- 
    129129  <p>If you have a line or two of code or <span class="caps">HTML</span> to embed, use extended block code like so:</p> 
    130130  <pre><code>./foo.pl% 
  • branches/superredcloth/test/definitions.yml

    r265 r267  
    66  - no:=no 
    77  - maybe:= yes 
    8 out: |- 
     8html: |- 
    99  <p>here is a RedCloth definition list:</p> 
    1010  <dl> 
     
    2323  - line-spanning 
    2424  term := hey, slick! 
    25 out: |- 
     25html: |- 
    2626  <dl> 
    2727        <dt>term</dt> 
     
    4040  - fabric 
    4141  - cloth := woven threads 
    42 out: |- 
     42html: |- 
    4343  <p>You can have multiple terms before a definition:</p> 
    4444  <dl> 
     
    6060  ok =: 
    6161  - regular term := no 
    62 out: |- 
     62html: |- 
    6363  <p>here is a long definition</p> 
    6464  <dl> 
  • branches/superredcloth/test/extra_whitespace.yml

    r265 r267  
    55 
    66  text 
    7 out: |- 
     7html: |- 
    88  <h1>Header</h1> 
    99  <p>text</p> 
     
    1515   
    1616  text 
    17 out: |- 
     17html: |- 
    1818  <h1>Header</h1> 
    1919  <p>text</p> 
     
    2424 
    2525  h1. Header 
    26 out: |- 
     26html: |- 
    2727  <p>text</p> 
    2828  <h1>Header</h1> 
     
    3434   
    3535  h1. Header 
    36 out: |- 
     36html: |- 
    3737  <p>text</p> 
    3838  <h1>Header</h1> 
     
    4242 
    4343  h1. Header 
    44 out: <h1>Header</h1> 
     44html: <h1>Header</h1> 
    4545--- 
    4646name: header with 2 blank lines above and with no text 
     
    4949 
    5050  h1. Header 
    51 out: <h1>Header</h1> 
     51html: <h1>Header</h1> 
    5252--- 
    5353name: header with 1 blank line below and with no text 
     
    5555  h1. Header 
    5656 
    57 out: <h1>Header</h1> 
     57html: <h1>Header</h1> 
    5858--- 
    5959name: header with 2 blank lines below and with no text 
     
    6262 
    6363 
    64 out: <h1>Header</h1> 
     64html: <h1>Header</h1> 
  • branches/superredcloth/test/helper.rb

    r257 r267  
    33require 'superredcloth' 
    44require 'yaml' 
     5 
     6def red(formatter, str) 
     7  SuperRedCloth.new(str).send("to_#{formatter}") 
     8end 
    59 
    610module Test 
  • branches/superredcloth/test/hobix.yml

    r265 r267  
    66   
    77  Followed by another. 
    8 out: |- 
     8html: |- 
    99  <p>A single paragraph.</p> 
    1010  <p>Followed by another.</p> 
     
    1818    I am <b>very</b> serious. 
    1919  </pre> 
    20 out: |- 
     20html: |- 
    2121  <p>I am <b>very</b> serious.</p> 
    2222  <pre> 
     
    2929  I spoke. 
    3030  And none replied. 
    31 out: |- 
     31html: |- 
    3232  <p>I spoke.<br /> 
    3333  And none replied.</p> 
     
    3636desc: Single- and double-quotes around words or phrases are converted to curly quotations, much easier on the eye. 
    3737in: "\"Observe!\"" 
    38 out: <p>&#8220;Observe!&#8221;</p> 
     38html: <p>&#8220;Observe!&#8221;</p> 
    3939---  
    4040name: double hyphens 
    4141desc: Double hyphens are replaced with an em-dash. 
    4242in: Observe--very nice! 
    43 out: <p>Observe&#8212;very nice!</p> 
     43html: <p>Observe&#8212;very nice!</p> 
    4444---  
    4545name: double hyphens with spaces 
    4646desc: Double hyphens are replaced with an em-dash and surrounding spaces are preserved. 
    4747in: Observe -- very nice! 
    48 out: <p>Observe &#8212; very nice!</p> 
     48html: <p>Observe &#8212; very nice!</p> 
    4949---  
    5050name: single hyphens with spaces 
    5151desc: Single hyphens are replaced with en-dashes if they are surrounded by spaces. 
    5252in: Observe - tiny and brief. 
    53 out: <p>Observe &#8211; tiny and brief.</p> 
     53html: <p>Observe &#8211; tiny and brief.</p> 
    5454---  
    5555name: midword hyphens  
    5656desc: Single hyphens are left alone if not surrounded by spaces. 
    5757in: Observe the nicely-done hyphen. 
    58 out: <p>Observe the nicely-done hyphen.</p> 
     58html: <p>Observe the nicely-done hyphen.</p> 
    5959---  
    6060name: ellipses 
    6161desc: Triplets of periods become an ellipsis. 
    6262in: Observe... 
    63 out: <p>Observe&#8230;</p> 
     63html: <p>Observe&#8230;</p> 
    6464---  
    6565name: dimension sign 
    6666desc: The letter 'x' becomes a dimension sign when used between digits. 
    6767in: "Observe: 2x3." 
    68 out: "<p>Observe: 2&#215;3.</p>" 
     68html: "<p>Observe: 2&#215;3.</p>" 
    6969---  
    7070name: dimension sign with spaces 
    7171in: "Observe: 2 x 4." 
    72 out: "<p>Observe: 2 &#215; 4.</p>" 
     72html: "<p>Observe: 2 &#215; 4.</p>" 
    7373---  
    7474name: dimension signs chained 
    7575in: "Observe: 2x3x4." 
    76 out: "<p>Observe: 2&#215;3&#215;4.</p>" 
     76html: "<p>Observe: 2&#215;3&#215;4.</p>" 
    7777---  
    7878name: trademark and copyright 
    7979desc: Conversion of trademark and copyright symbols. 
    8080in: one(TM), two(R), three(C). 
    81 out: <p>one&#8482;, two&#174;, three&#169;.</p> 
     81html: <p>one&#8482;, two&#174;, three&#169;.</p> 
    8282---  
    8383name: headers 
    8484desc: To make an entire paragraph into a Header, place “h<em>n</em>.” at its beginning, where <em>n</em> is a number from 1-6. 
    8585in: h3. Header 3 
    86 out: <h3>Header 3</h3> 
     86html: <h3>Header 3</h3> 
    8787---  
    8888name: blockquote 
     
    9494   
    9595  Any old text 
    96 out: |- 
     96html: |- 
    9797  <p>Any old text</p> 
    9898  <blockquote> 
     
    104104desc: Numeric references within text to footnotes appear between square brackets. 
    105105in: This is covered elsewhere[1]. 
    106 out: <p>This is covered elsewhere<sup class="footnote"><a href="#fn1">1</a></sup>.</p> 
     106html: <p>This is covered elsewhere<sup class="footnote"><a href="#fn1">1</a></sup>.</p> 
    107107---  
    108108name: footnote 
    109109desc: To create the footnote that corresponds to its reference within the text, begin a new paragraph with fn and the footnote&#8217;s number, followed by a dot and a space. 
    110110in: fn1. Down here, in fact. 
    111 out: <p class="footnote" id="fn1"><sup>1</sup> Down here, in fact.</p> 
     111html: <p class="footnote" id="fn1"><sup>1</sup> Down here, in fact.</p> 
    112112---  
    113113name: em 
    114114desc: Emphasis to text is added by surrounding a phrase with underscores.  In HTML, this often appears as <em>italics</em>. 
    115115in: I _believe_ every word. 
    116 out: <p>I <em>believe</em> every word.</p> 
     116html: <p>I <em>believe</em> every word.</p> 
    117117---  
    118118name: strong 
    119119desc: Strength can be give to text by surrounding with asterisks.  In HTML, this strength appears as <strong>bold</strong>. 
    120120in: And then? She *fell*! 
    121 out: <p>And then? She <strong>fell</strong>!</p> 
     121html: <p>And then? She <strong>fell</strong>!</p> 
    122122---  
    123123name: force bold italics 
     
    126126  I __know__. 
    127127  I **really** __know__. 
    128 out: |- 
     128html: |- 
    129129  <p>I <i>know</i>.<br /> 
    130130  I <b>really</b> <i>know</i>.</p> 
     
    133133desc: Use double question marks to indicate <em>citation</em>.  The title of a book, for instance. 
    134134in: ??Cat's Cradle?? by Vonnegut 
    135 out: <p><cite>Cat&#8217;s Cradle</cite> by Vonnegut</p> 
     135html: <p><cite>Cat&#8217;s Cradle</cite> by Vonnegut</p> 
    136136---  
    137137name: code phrases 
    138138desc: Code phrases can be surrounded by at-symbols. 
    139139in: Convert with @r.to_html@ 
    140 out: <p>Convert with <code>r.to_html</code></p> 
     140html: <p>Convert with <code>r.to_html</code></p> 
    141141---  
    142142name: del 
    143143desc: To indicate a passage which has been deleted, surround the passage with hypens. 
    144144in: I'm -sure- not sure. 
    145 out: <p>I&#8217;m <del>sure</del> not sure.</p> 
     145html: <p>I&#8217;m <del>sure</del> not sure.</p> 
    146146---  
    147147name: ins 
    148148desc: Pluses around a passage indicate its insertion. 
    149149in: You are a +pleasant+ child. 
    150 out: <p>You are a <ins>pleasant</ins> child.</p> 
     150html: <p>You are a <ins>pleasant</ins> child.</p> 
    151151---  
    152152name: superscript 
    153153desc: To superscript a phrase, surround with carets. 
    154154in: a ^2^ + b ^2^ = c ^2^ 
    155 out: <p>a <sup>2</sup> + b <sup>2</sup> = c <sup>2</sup></p> 
     155html: <p>a <sup>2</sup> + b <sup>2</sup> = c <sup>2</sup></p> 
    156156---  
    157157name: subscript 
    158158desc: To subscript, surround with tildes. 
    159159in: log ~2~ x 
    160 out: <p>log <sub>2</sub> x</p> 
     160html: <p>log <sub>2</sub> x</p> 
    161161---  
    162162name: span 
    163163desc: Lastly, if you find yourself needing to customize the style of a passage, use percent symbols to translate the passage as an HTML span. 
    164164in: I'm %unaware% of most soft drinks. 
    165 out: <p>I&#8217;m <span>unaware</span> of most soft drinks.</p> 
     165html: <p>I&#8217;m <span>unaware</span> of most soft drinks.</p> 
    166166---  
    167167name: style span 
     
    170170  I'm %{color:red}unaware% 
    171171  of most soft drinks. 
    172 out: |- 
     172html: |- 
    173173  <p>I&#8217;m <span style="color:red;">unaware</span><br /> 
    174174  of most soft drinks.</p> 
     
    177177desc: A block can be tagged with a CSS class by circling the class in parentheses and placing it just before the period which marks the block. 
    178178in: p(example1). An example 
    179 out: <p class="example1">An example</p> 
     179html: <p class="example1">An example</p> 
    180180---  
    181181name: css id 
    182182desc: An element ID can be given by prefixing the ID with a pound symbol and using it in place of the class. 
    183183in: p(#big-red). Red here 
    184 out: <p id="big-red">Red here</p> 
     184html: <p id="big-red">Red here</p> 
    185185---  
    186186name: class and id combined 
    187187desc: Class and ID can be combined by placing the class first. 
    188188in: p(example1#big-red2). Red here 
    189 out: <p class="example1" id="big-red2">Red here</p> 
     189html: <p class="example1" id="big-red2">Red here</p> 
    190190---  
    191191name: css style 
    192192desc: Style settings can be provided directly by surrounding them in curly braces. 
    193193in: p{color:blue;margin:30px}. Spacey blue 
    194 out: <p style="color:blue;margin:30px;">Spacey blue</p> 
     194html: <p style="color:blue;margin:30px;">Spacey blue</p> 
    195195---  
    196196name: language designations 
    197197desc: Language designations can be given between angel brackets. 
    198198in: p[fr]. rouge 
    199 out: <p lang="fr">rouge</p> 
     199html: <p lang="fr">rouge</p> 
    200200---  
    201201name: block attributes on phrase modifiers 
     
    206206  corn stalk from my 
    207207  %[es]cabeza%. 
    208 out: |- 
     208html: |- 
    209209  <p>I seriously <strong style="color:red;">blushed</strong><br /> 
    210210  when I <em class="big">sprouted</em> that<br /> 
     
    215215desc: Text inside blocks can be aligned in four basic ways. 
    216216in: p<>. justified 
    217 out: <p style="text-align:justify;">justified</p> 
     217html: <p style="text-align:justify;">justified</p> 
    218218---  
    219219name: indentation 
    220220desc: Indentation can also be specified by provide a single left paren for every 1em to the left.  A single right paren for every 1em to the right. 
    221221in: p))). right ident 3em 
    222 out: <p style="padding-right:3em;">right ident 3em</p> 
     222html: <p style="padding-right:3em;">right ident 3em</p> 
    223223---  
    224224name: indentation and alignment 
    225225desc: Identation may be coupled with alignment. 
    226226in: h2()>. Bingo. 
    227 out: <h2 style="padding-left:1em;padding-right:1em;text-align:right;">Bingo.</h2> 
     227html: <h2 style="padding-left:1em;padding-right:1em;text-align:right;">Bingo.</h2> 
    228228---  
    229229name: many modifiers combined 
    230230desc: And, furthermore, coupled with language settings and CSS styles. 
    231231in: h3()>[no]{color:red}. Bingo 
    232 out: <h3 style="padding-left:1em;padding-right:1em;text-align:right;color:red;" lang="no">Bingo</h3> 
     232html: <h3 style="padding-left:1em;padding-right:1em;text-align:right;color:red;" lang="no">Bingo</h3> 
    233233---  
    234234name: code blocks 
     
    240240  </code> 
    241241  </pre> 
    242 out: |- 
     242html: |- 
    243243  <pre> 
    244244  <code> 
     
    260260   
    261261  The main text of the page goes here and will stay to the left of the sidebar. 
    262 out: |- 
     262html: |- 
    263263  <div style="float:right;"> 
    264264 
     
    276276  # A second item 
    277277  # A third 
    278 out: |- 
     278html: |- 
    279279  <ol> 
    280280        <li>A first item</li> 
     
    293293  ## Water 
    294294  ## Protein 
    295 out: |- 
     295html: |- 
    296296  <ol> 
    297297        <li>Fuel could be: 
     
    314314  * A second item 
    315315  * A third 
    316 out: |- 
     316html: |- 
    317317  <ul> 
    318318        <li>A first item</li> 
     
    331331  ** Water 
    332332  ** Protein 
    333 out: |- 
     333html: |- 
    334334  <ul> 
    335335        <li>Fuel could be: 
     
    349349desc: Basic links are comprised of a phrase which is linked to a <acronym title="Universal Resource Locator">URL</acronym>.  Place the descriptive phrase in quotation marks.  Follow it immediately by a colon and the URL. 
    350350in: I searched "Google":http://google.com. 
    351 out: <p>I searched <a href="http://google.com">Google</a>.</p> 
     351html: <p>I searched <a href="http://google.com">Google</a>.</p> 
    352352---  
    353353name: link aliases 
     
    359359   
    360360  [hobix]http://hobix.com 
    361 out: |- 
     361html: |- 
    362362  <p>I am crazy about <a href="http://hobix.com">Hobix</a><br /> 
    363363  and <a href="http://hobix.com">it&#8217;s</a> <a href="http://hobix.com">all</a> I ever<br /> 
     
    367367desc: You can embed an image in your Textile document by surrounding its URL with exclamation marks. 
    368368in: "!http://hobix.com/sample.jpg!" 
    369 out: <p><img src="http://hobix.com/sample.jpg" alt="" /></p> 
     369html: <p><img src="http://hobix.com/sample.jpg" alt="" /></p> 
    370370---  
    371371name: image title 
    372372desc: A title for the image can also be provided in parens, just before the closing exclamation. 
    373373in: "!openwindow1.gif(Bunny.)!" 
    374 out: <p><img src="openwindow1.gif" title="Bunny." alt="Bunny." /></p> 
     374html: <p><img src="openwindow1.gif" title="Bunny." alt="Bunny." /></p> 
    375375---  
    376376name: image links 
    377377desc: Links can be attached to images with a colon. 
    378378in: "!openwindow1.gif!:http://hobix.com/" 
    379 out: <p><a href="http://hobix.com/"><img src="openwindow1.gif" alt="" /></a></p> 
     379html: <p><a href="http://hobix.com/"><img src="openwindow1.gif" alt="" /></a></p> 
    380380---  
    381381name: image alignments 
     
    386386  And others sat all round the small 
    387387  machine and paid it to sing to them. 
    388 out: |- 
     388html: |- 
    389389  <p style="float:right;"><img src="obake.gif" alt="" /></p> 
    390390  <p>And others sat all round the small<br /> 
     
    394394desc: Definitions for acronyms can be provided by following an acronym with its definition in parens. 
    395395in: We use CSS(Cascading Style Sheets). 
    396 out: <p>We use <acronym title="Cascading Style Sheets"><span class="caps">CSS</span></acronym>.</p> 
     396html: <p>We use <acronym title="Cascading Style Sheets"><span class="caps">CSS</span></acronym>.</p> 
    397397---  
    398398name: tables 
     
    403403  | archie | 29 | m | 
    404404  | bella | 45 | f | 
    405 out: |- 
     405html: |- 
    406406  <table> 
    407407        <tr> 
     
    434434  | archie | 29 | m | 
    435435  | bella | 45 | f | 
    436 out: |- 
     436html: |- 
    437437  <table> 
    438438        <tr> 
     
    468468  |^. valign top | 
    469469  |~. bottom | 
    470 out: |- 
     470html: |- 
    471471  <table> 
    472472        <tr> 
     
    498498  |\2. spans two cols | 
    499499  | col 1 | col 2 | 
    500 out: |- 
     500html: |- 
    501501  <table> 
    502502        <tr> 
     
    515515  | b | 
    516516  | c | 
    517 out: |- 
     517html: |- 
    518518  <table> 
    519519        <tr> 
     
    532532desc: All block attributes can be applied to table cells as well. 
    533533in: "|{background:#ddd}. Grey cell|" 
    534 out