From 61d13e28d97b124239b530b1e336395d90953793 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Paul=20H=C3=A4nsch?= Date: Thu, 29 Aug 2024 21:14:40 +0200 Subject: [PATCH] tests for references and macros --- tests-markdown.sh | 54 ++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 49 insertions(+), 5 deletions(-) diff --git a/tests-markdown.sh b/tests-markdown.sh index 01fbda1..0ffc3d3 100755 --- a/tests-markdown.sh +++ b/tests-markdown.sh @@ -77,6 +77,8 @@ assert '[![Wikipedia](wikilogo.png)]()'\ '

Wikipedia

'\ "Image Link" +assert ' <" _foo_>>' '

macro /test -- "* weird <args>" _foo_

' "Macros" + # Block checks printf '\n## Testing Block markup ##\n' @@ -162,7 +164,7 @@ assert '![Testbild](Test Bild.jpg)' \ assert '![Testbild](Test Bild.jpg "German Television *test* image ca. 1994")' \ '
Testbild
German Television test image ca. 1994
' \ -"inline image" +"block image" assert '![Testbild *ARD*](Test Bild.jpg){tv ard function-check}' \ '
Testbild *ARD*
' \ @@ -306,7 +308,7 @@ assert ' # 'Pipe Tables' assert '+---+---+---+ -|Col 1| Col 2 | Col 3| +|Col 1\\| Col\|2 | Col 3| +===+:==:+===+ | * foo1 | *bar* |```| | * foo2 | **qua** |code | @@ -316,8 +318,8 @@ assert '+---+---+---+ +-------+-----+----+ ' \ ' - @@ -359,4 +361,46 @@ sub bar ' \ 'Headline Nesting' -printf '\nAll test passed!\n' +# Reference syntax checks +printf '\n## Testing reference syntax ##\n' + +assert 'Foo bar [Link] [1] for show + +The same in [en][] + +[en]: +[1]: http://de.wikipedia.org "Online Encyclopedia"' \ +'

Foo bar Link for show

+ +

The same in en

' \ +"Reference Links" + +assert 'Foo bar [Link] [1] for show + +[en]: +[1]: http://de.wikipedia.org + "Online Encyclopedia"' \ +'

Foo bar Link for show

' \ +"Reference Links" + +assert 'Foo bar ![Image] [1] for show + +The same as ![PNG][] + +[PNG]: +[1]: http://de.wikipedia.org/logo.jpg "Online Encyclopedia"' \ +'

Foo bar Image for show

+ +

The same as PNG

' \ +"Reference images" + +assert '![Image] [1] + +[PNG]: +[1]: http://de.wikipedia.org/logo.jpg "Online Encyclopedia"' \ +'
Image
Online Encyclopedia
' \ +"Reference images (block)" + +assert '<" _foo_>>' 'macro /test -- "* weird <args>" _foo_' "Macros/Block" + +printf '\nAll tests passed!\n' -- 2.39.2

Col 1

-

Col 2

+

Col 1\

+

Col|2

Col 3