Skip to content

Commit

Permalink
Add markdown document renderers to unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Witiko committed Jan 6, 2022
1 parent 2199c22 commit 4a70b04
Show file tree
Hide file tree
Showing 108 changed files with 214 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ jobs:
RESULT="$(printf '%s\n' 'Hello *Markdown*! $a_x + b_x = c_x$' |
docker run --rm -i witiko/markdown:${{ matrix.texlive }} markdown-cli hybrid=true underscores=false |
tee /dev/stderr)"
test "$RESULT" = 'Hello \markdownRendererEmphasis{Markdown}! $a_x + b_x = c_x$\relax'
test "$RESULT" = '\markdownRendererDocumentBegin'$'\n''Hello \markdownRendererEmphasis{Markdown}! $a_x + b_x = c_x$\markdownRendererDocumentEnd'
- name: Run unit tests
run: docker run -v "$PWD":/git-repo -w /git-repo witiko/markdown:${{ matrix.texlive }} make test
- name: Build distribution archives
Expand Down
2 changes: 1 addition & 1 deletion tests/support/frozen-cache.tex
Original file line number Diff line number Diff line change
@@ -1 +1 @@
\expandafter\def\csname markdownFrozenCache0\endcsname{\markdownRendererEmphasis{This is the content of the frozen cache.}}
\expandafter\def\csname markdownFrozenCache0\endcsname{\markdownRendererDocumentBegin\markdownRendererEmphasis{This is the content of the frozen cache.}\markdownRendererDocumentEnd}
2 changes: 2 additions & 0 deletions tests/testfiles/CommonMark_0.26/fenced-code.test
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ Unclosed code blocks are closed by the end of the document (or the enclosing blo
```
aaa
>>>
documentBegin
interblockSeparator
BEGIN fencedCode
- src: ./_markdown_test/a5bb6f19317db18187d78abe91f5e93c.verbatim
Expand Down Expand Up @@ -313,3 +314,4 @@ BEGIN fencedCode
- src: ./_markdown_test/bf41e9999cfc44d815c2a227bc67b1ab.verbatim
- infostring:
END fencedCode
documentEnd
2 changes: 2 additions & 0 deletions tests/testfiles/Markdown_1.0.3/amps-encoding.test
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ Here's an inline [link](</script?foo=1&bar=2>).
[1]: http://example.com/?foo=1&bar=2
[2]: http://att.com/ "AT&T"
>>>
documentBegin
BEGIN link
- label: link
- URI: http://example.com/?foo=1(ampersand)bar=2
Expand All @@ -34,3 +35,4 @@ BEGIN link
- URI: /script?foo=1(ampersand)bar=2
- title:
END link
documentEnd
2 changes: 2 additions & 0 deletions tests/testfiles/Markdown_1.0.3/auto-links.test
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ Auto-links should not occur here: `<http://example.com/>`

or here: <http://example.com/>
>>>
documentBegin
BEGIN link
- label: http://example.com/
- URI: http://example.com/
Expand Down Expand Up @@ -50,3 +51,4 @@ interblockSeparator
codeSpan: <http://example.com/>
interblockSeparator
inputVerbatim: ./_markdown_test/d063938ba4264a9a85f58f4eb996f49a.verbatim
documentEnd
2 changes: 2 additions & 0 deletions tests/testfiles/Markdown_1.0.3/backslash-escapes.test
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ This is a tag with unescaped backticks <span attr='`ticks`'>bar</span>.

This is a tag with backslashes <span attr='\\backslashes\\'>bar</span>.
>>>
documentBegin
interblockSeparator
backslash
interblockSeparator
Expand Down Expand Up @@ -190,3 +191,4 @@ codeSpan: ticks
interblockSeparator
backslash
backslash
documentEnd
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,12 @@
> }

>>>
documentBegin
blockQuoteBegin
interblockSeparator
inputVerbatim: ./_markdown_test/9d1287e577b61c6969fcf3c6f5f56068.verbatim
interblockSeparator
interblockSeparator
inputVerbatim: ./_markdown_test/8be451539403358f26932093849e3c95.verbatim
blockQuoteEnd
documentEnd
2 changes: 2 additions & 0 deletions tests/testfiles/Markdown_1.0.3/code-blocks.test
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,12 @@ Regular Text.

code block on the last line
>>>
documentBegin
inputVerbatim: ./_markdown_test/0ce1606380714a85685e1b8b4c818188.verbatim
interblockSeparator
interblockSeparator
inputVerbatim: ./_markdown_test/3d9ad8836bff9bd942de9d19fa9d023b.verbatim
interblockSeparator
interblockSeparator
inputVerbatim: ./_markdown_test/5b71bb29e431424ea95f56b2ed675bf5.verbatim
documentEnd
2 changes: 2 additions & 0 deletions tests/testfiles/Markdown_1.0.3/code-spans.test
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<<<
Here's how you put `` `backticks` `` in a code span.
>>>
documentBegin
codeSpan: `backticks`
documentEnd
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,6 @@ Here's one with a bullet.
* criminey.

>>>
documentBegin
interblockSeparator
documentEnd
2 changes: 2 additions & 0 deletions tests/testfiles/Markdown_1.0.3/horizontal-rules.test
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ _ _ _
_ _ _

>>>
documentBegin
interblockSeparator
horizontalRule
interblockSeparator
Expand Down Expand Up @@ -130,3 +131,4 @@ interblockSeparator
horizontalRule
interblockSeparator
inputVerbatim: ./_markdown_test/23f30f77015603313f80e6d0da15d7fe.verbatim
documentEnd
2 changes: 2 additions & 0 deletions tests/testfiles/Markdown_1.0.3/links-inline-style.test
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ Just a [URL](/url/).
[Empty]().

>>>
documentBegin
BEGIN link
- label: URL
- URI: /url/
Expand Down Expand Up @@ -48,3 +49,4 @@ BEGIN link
- URI:
- title:
END link
documentEnd
2 changes: 2 additions & 0 deletions tests/testfiles/Markdown_1.0.3/links-reference-style.test
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ breaks] across lines.
[link breaks]: /url/

>>>
documentBegin
BEGIN link
- label: bar
- URI: /url/
Expand Down Expand Up @@ -174,3 +175,4 @@ BEGIN link
- URI: /url/
- title:
END link
documentEnd
2 changes: 2 additions & 0 deletions tests/testfiles/Markdown_1.0.3/links-shortcut-references.test
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ break].
[other]: /other

>>>
documentBegin
BEGIN link
- label: simple case
- URI: /simple
Expand All @@ -40,3 +41,4 @@ BEGIN link
- URI: /other
- title:
END link
documentEnd
2 changes: 2 additions & 0 deletions tests/testfiles/Markdown_1.0.3/literal-quotes-in-titles.test
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ Foo [bar](/url/ "Title with "quotes" inside").


>>>
documentBegin
BEGIN link
- label: bar
- URI: /url/
Expand All @@ -19,3 +20,4 @@ BEGIN link
- URI: /url/
- title: Title with "quotes" inside
END link
documentEnd
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,7 @@ Output:
</code></pre>

>>>
documentBegin
headingOne: Markdown: Basics
interblockSeparator
headingTwo: Getting the Gist of Markdown's Formatting Syntax
Expand Down Expand Up @@ -434,3 +435,4 @@ inputVerbatim: ./_markdown_test/7d9f1e26a42e0270218d0c17064c2013.verbatim
interblockSeparator
interblockSeparator
inputVerbatim: ./_markdown_test/e1de0455cbe83acebe6cfa078bdcb1cc.verbatim
documentEnd
Original file line number Diff line number Diff line change
Expand Up @@ -879,6 +879,7 @@ Markdown provides backslash escapes for the following characters:
! exclamation mark

>>>
documentBegin
headingOne: Markdown: Syntax
interblockSeparator
ulBeginTight
Expand Down Expand Up @@ -1516,3 +1517,4 @@ inputVerbatim: ./_markdown_test/48f8d6f10d4f5f67fd448d4d52284296.verbatim
interblockSeparator
interblockSeparator
inputVerbatim: ./_markdown_test/04418d019c77b632c835de3e798283f7.verbatim
documentEnd
2 changes: 2 additions & 0 deletions tests/testfiles/Markdown_1.0.3/nested-blockquotes.test
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,11 @@
> foo

>>>
documentBegin
blockQuoteBegin
interblockSeparator
blockQuoteBegin
blockQuoteEnd
interblockSeparator
blockQuoteEnd
documentEnd
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ This was an error in Markdown 1.0.1:
that

>>>
documentBegin
headingTwo: Unordered
interblockSeparator
interblockSeparator
Expand Down Expand Up @@ -321,3 +322,4 @@ ulEndTight
interblockSeparator
ulItemEnd
ulEnd
documentEnd
2 changes: 2 additions & 0 deletions tests/testfiles/Markdown_1.0.3/strong-and-em-together.test
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,12 @@ ___This is strong and em.___
So is ___this___ word.

>>>
documentBegin
strongEmphasis: (emphasis: This is strong and em.)
interblockSeparator
strongEmphasis: (emphasis: this)
interblockSeparator
strongEmphasis: (emphasis: This is strong and em.)
interblockSeparator
strongEmphasis: (emphasis: this)
documentEnd
2 changes: 2 additions & 0 deletions tests/testfiles/Markdown_1.0.3/tabs.test
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ And:
indented with spaces

>>>
documentBegin
ulBegin
ulItem
ulItemEnd
Expand All @@ -37,3 +38,4 @@ inputVerbatim: ./_markdown_test/7b4c059fd391119f1afdffcb9aa2e6d7.verbatim
interblockSeparator
interblockSeparator
inputVerbatim: ./_markdown_test/1ad8ee27ab4fcae258439433e5866228.verbatim
documentEnd
2 changes: 2 additions & 0 deletions tests/testfiles/PHP_Markdown/auto-links.test
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

<hr@company.com>
>>>
documentBegin
BEGIN link
- label: HTTP://WWW.SOMEURL.COM
- URI: HTTP://WWW.SOMEURL.COM
Expand All @@ -14,3 +15,4 @@ BEGIN link
- URI: mailto:hr@company.com
- title:
END link
documentEnd
2 changes: 2 additions & 0 deletions tests/testfiles/PHP_Markdown/backslash-escapes.test
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ backslash with \\> greater than

\\\*no emphasis*
>>>
documentBegin
interblockSeparator
backslash
interblockSeparator
Expand All @@ -17,3 +18,4 @@ interblockSeparator
backslash
interblockSeparator
backslash
documentEnd
2 changes: 2 additions & 0 deletions tests/testfiles/PHP_Markdown/code-block-in-a-list-item.test
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

code block with whitespace on preceding line
>>>
documentBegin
ulBegin
ulItem
interblockSeparator
Expand All @@ -29,3 +30,4 @@ interblockSeparator
inputVerbatim: ./_markdown_test/76f4166a488956dfe5082ca0ab4ca21f.verbatim
ulItemEnd
ulEnd
documentEnd
2 changes: 2 additions & 0 deletions tests/testfiles/PHP_Markdown/code-block-on-second-line.test
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,6 @@
Codeblock on second line

>>>
documentBegin
inputVerbatim: ./_markdown_test/1a728d8504cb30370a61eb99e6709c67.verbatim
documentEnd
2 changes: 2 additions & 0 deletions tests/testfiles/PHP_Markdown/email-auto-links.test
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

International domain names: <help@tūdaliņ.lv>
>>>
documentBegin
BEGIN link
- label: michel.fortin@michelf.com
- URI: mailto:michel.fortin@michelf.com
Expand All @@ -14,3 +15,4 @@ BEGIN link
- URI: mailto:help@tūdaliņ.lv
- title:
END link
documentEnd
2 changes: 2 additions & 0 deletions tests/testfiles/PHP_Markdown/emphasis.test
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ _____Cut here_____
____Cut here____

>>>
documentBegin
interblockSeparator
olBeginTight
olItemWithNumber: 1
Expand Down Expand Up @@ -270,3 +271,4 @@ underscore
underscore
underscore
underscore
documentEnd
2 changes: 2 additions & 0 deletions tests/testfiles/PHP_Markdown/empty-list-item.test
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ With hyphens
-

>>>
documentBegin
interblockSeparator
ulBeginTight
ulItem
Expand Down Expand Up @@ -95,3 +96,4 @@ ulItemEnd
ulItem
ulItemEnd
ulEndTight
documentEnd
2 changes: 2 additions & 0 deletions tests/testfiles/PHP_Markdown/headers.test
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,12 @@ Paragraphr

Paragraph
>>>
documentBegin
headingThree: Header
interblockSeparator
horizontalRule
interblockSeparator
interblockSeparator
horizontalRule
interblockSeparator
documentEnd
2 changes: 2 additions & 0 deletions tests/testfiles/PHP_Markdown/horizontal-rules.test
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ j j j
n n n

>>>
documentBegin
interblockSeparator
horizontalRule
interblockSeparator
Expand All @@ -49,3 +50,4 @@ interblockSeparator
interblockSeparator
interblockSeparator
interblockSeparator
documentEnd
2 changes: 2 additions & 0 deletions tests/testfiles/PHP_Markdown/links-inline-style.test
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@
[silly URL w/ angle brackets](<?}]*+|&)>).

>>>
documentBegin
BEGIN link
- label: silly URL w/ angle brackets
- URI: ?(rightBrace)]*+(pipe)(ampersand))
- title:
END link
documentEnd
2 changes: 2 additions & 0 deletions tests/testfiles/PHP_Markdown/md5-hashes.test
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ The MD5 value for `<p>test</p>` is:

6205333b793f34273d75379350b36826
>>>
documentBegin
headingOne: Character Escapes
interblockSeparator
codeSpan: +
Expand All @@ -20,3 +21,4 @@ interblockSeparator
interblockSeparator
codeSpan: <p>test</p>
interblockSeparator
documentEnd
2 changes: 2 additions & 0 deletions tests/testfiles/PHP_Markdown/mixed-ols-and-uls.test
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
2. test

>>>
documentBegin
ulBeginTight
ulItem
ulItemEnd
Expand Down Expand Up @@ -45,3 +46,4 @@ olItemEnd
olItemWithNumber: 2
olItemEnd
olEndTight
documentEnd
Loading

0 comments on commit 4a70b04

Please sign in to comment.