aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/Tests/Readers/Markdown.hs20
-rw-r--r--tests/Tests/Readers/RST.hs60
-rw-r--r--tests/writer.context2
-rw-r--r--tests/writer.dokuwiki14
-rw-r--r--tests/writer.html2
5 files changed, 69 insertions, 29 deletions
diff --git a/tests/Tests/Readers/Markdown.hs b/tests/Tests/Readers/Markdown.hs
index ed79f9e3d..17bfd332e 100644
--- a/tests/Tests/Readers/Markdown.hs
+++ b/tests/Tests/Readers/Markdown.hs
@@ -119,6 +119,10 @@ bareLinkTests =
autolink "http://business.timesonline.co.uk/article/0,,9065-2473189,00.html")
, ("http://www.mail-archive.com/ruby-talk@ruby-lang.org/",
autolink "http://www.mail-archive.com/ruby-talk@ruby-lang.org/")
+ , ("https://example.org/?anchor=lala-",
+ autolink "https://example.org/?anchor=lala-")
+ , ("https://example.org/?anchor=-lala",
+ autolink "https://example.org/?anchor=-lala")
]
{-
@@ -190,11 +194,25 @@ tests = [ testGroup "inline code"
=?> para (link "/there.0" "" "hi")
]
, testGroup "bare URIs"
- (map testBareLink bareLinkTests)
+ (map testBareLink bareLinkTests)
, testGroup "autolinks"
[ "with unicode dash following" =:
"<http://foo.bar>\8212" =?> para (autolink "http://foo.bar" <>
str "\8212")
+ , "a partial URL (#2277)" =:
+ "<www.boe.es/buscar/act.php?id=BOE-A-1996-8930#a66>" =?>
+ para (text "<www.boe.es/buscar/act.php?id=BOE-A-1996-8930#a66>")
+ ]
+ , testGroup "links"
+ [ "no autolink inside link" =:
+ "[<https://example.org>](url)" =?>
+ para (link "url" "" (text "<https://example.org>"))
+ , "no inline link inside link" =:
+ "[[a](url2)](url)" =?>
+ para (link "url" "" (text "[a](url2)"))
+ , "no bare URI inside link" =:
+ "[https://example.org(](url)" =?>
+ para (link "url" "" (text "https://example.org("))
]
, testGroup "Headers"
[ "blank line before header" =:
diff --git a/tests/Tests/Readers/RST.hs b/tests/Tests/Readers/RST.hs
index 7f1f3d044..48abc16f8 100644
--- a/tests/Tests/Readers/RST.hs
+++ b/tests/Tests/Readers/RST.hs
@@ -22,7 +22,8 @@ tests :: [Test]
tests = [ "line block with blank line" =:
"| a\n|\n| b" =?> para (str "a") <>
para (str "\160b")
- , "field list" =: unlines
+ , testGroup "field list"
+ [ "general" =: unlines
[ "para"
, ""
, ":Hostname: media08"
@@ -36,17 +37,17 @@ tests = [ "line block with blank line" =:
, ":Parameter i: integer"
, ":Final: item"
, " on two lines" ]
- =?> ( doc
- $ para "para" <>
- definitionList [ (str "Hostname", [para "media08"])
- , (str "IP address", [para "10.0.0.19"])
- , (str "Size", [para "3ru"])
- , (str "Version", [para "1"])
- , (str "Indentation", [para "Since the field marker may be quite long, the second and subsequent lines of the field body do not have to line up with the first line, but they must be indented relative to the field name marker, and they must line up with each other."])
- , (str "Parameter i", [para "integer"])
- , (str "Final", [para "item on two lines"])
- ])
- , "initial field list" =: unlines
+ =?> ( doc
+ $ para "para" <>
+ definitionList [ (str "Hostname", [para "media08"])
+ , (text "IP address", [para "10.0.0.19"])
+ , (str "Size", [para "3ru"])
+ , (str "Version", [para "1"])
+ , (str "Indentation", [para "Since the field marker may be quite long, the second and subsequent lines of the field body do not have to line up with the first line, but they must be indented relative to the field name marker, and they must line up with each other."])
+ , (text "Parameter i", [para "integer"])
+ , (str "Final", [para "item on two lines"])
+ ])
+ , "metadata" =: unlines
[ "====="
, "Title"
, "====="
@@ -56,10 +57,31 @@ tests = [ "line block with blank line" =:
, ""
, ":Version: 1"
]
- =?> ( setMeta "version" (para "1")
- $ setMeta "title" ("Title" :: Inlines)
- $ setMeta "subtitle" ("Subtitle" :: Inlines)
- $ doc mempty )
+ =?> ( setMeta "version" (para "1")
+ $ setMeta "title" ("Title" :: Inlines)
+ $ setMeta "subtitle" ("Subtitle" :: Inlines)
+ $ doc mempty )
+ , "with inline markup" =: unlines
+ [ ":*Date*: today"
+ , ""
+ , ".."
+ , ""
+ , ":*one*: emphasis"
+ , ":two_: reference"
+ , ":`three`_: another one"
+ , ":``four``: literal"
+ , ""
+ , ".. _two: http://example.com"
+ , ".. _three: http://example.org"
+ ]
+ =?> ( setMeta "date" (str "today")
+ $ doc
+ $ definitionList [ (emph "one", [para "emphasis"])
+ , (link "http://example.com" "" "two", [para "reference"])
+ , (link "http://example.org" "" "three", [para "another one"])
+ , (code "four", [para "literal"])
+ ])
+ ]
, "URLs with following punctuation" =:
("http://google.com, http://yahoo.com; http://foo.bar.baz.\n" ++
"http://foo.bar/baz_(bam) (http://foo.bar)") =?>
@@ -69,9 +91,9 @@ tests = [ "line block with blank line" =:
link "http://foo.bar/baz_(bam)" "" "http://foo.bar/baz_(bam)"
<> " (" <> link "http://foo.bar" "" "http://foo.bar" <> ")")
, "Reference names with special characters" =:
- ("A-1-B_2_C:3:D+4+E.5.F_\n\n" ++
- ".. _A-1-B_2_C:3:D+4+E.5.F: https://example.com\n") =?>
- para (link "https://example.com" "" "A-1-B_2_C:3:D+4+E.5.F")
+ ("A-1-B_2_C:3:D+4+E.5.F_\n\n" ++
+ ".. _A-1-B_2_C:3:D+4+E.5.F: https://example.com\n") =?>
+ para (link "https://example.com" "" "A-1-B_2_C:3:D+4+E.5.F")
, testGroup "literal / line / code blocks"
[ "indented literal block" =: unlines
[ "::"
diff --git a/tests/writer.context b/tests/writer.context
index 244463f93..29af26dba 100644
--- a/tests/writer.context
+++ b/tests/writer.context
@@ -25,7 +25,7 @@
\definedescription
[description]
- [headstyle=bold, style=normal, location=hanging, width=broad, margin=1cm]
+ [headstyle=bold, style=normal, location=hanging, width=broad, margin=1cm, alternative=hanging]
\setupitemize[autointro] % prevent orphan list intro
\setupitemize[indentnext=no]
diff --git a/tests/writer.dokuwiki b/tests/writer.dokuwiki
index e984d391e..fe1f8296a 100644
--- a/tests/writer.dokuwiki
+++ b/tests/writer.dokuwiki
@@ -454,13 +454,13 @@ Ellipses…and…and….
====== LaTeX ======
*
- * <math>2+2=4</math>
- * <math>x \in y</math>
- * <math>\alpha \wedge \omega</math>
- * <math>223</math>
- * <math>p</math>-Tree
- * Here’s some display math: <math>\frac{d}{dx}f(x)=\lim_{h\to 0}\frac{f(x+h)-f(x)}{h}</math>
- * Here’s one that has a line break in it: <math>\alpha + \omega \times x^2</math>.
+ * $2+2=4$
+ * $x \in y$
+ * $\alpha \wedge \omega$
+ * $223$
+ * $p$-Tree
+ * Here’s some display math: $\frac{d}{dx}f(x)=\lim_{h\to 0}\frac{f(x+h)-f(x)}{h}$
+ * Here’s one that has a line break in it: $\alpha + \omega \times x^2$.
These shouldn’t be math:
diff --git a/tests/writer.html b/tests/writer.html
index 1357fa7c4..4a60a7b97 100644
--- a/tests/writer.html
+++ b/tests/writer.html
@@ -481,7 +481,7 @@ Blah
<p><script type="text/javascript">
<!--
h='&#110;&#x6f;&#x77;&#104;&#x65;&#114;&#x65;&#46;&#110;&#x65;&#116;';a='&#64;';n='&#110;&#x6f;&#98;&#x6f;&#100;&#x79;';e=n+a+h;
-document.write('<a h'+'ref'+'="ma'+'ilto'+':'+e+'" clas'+'s="em' + 'ail">'+'Email link'+'<\/'+'a'+'>');
+document.write('<a h'+'ref'+'="ma'+'ilto'+':'+e+'" clas'+'s="em' + 'ail">'+'&#x45;&#x6d;&#x61;&#x69;&#108;&#32;&#108;&#x69;&#110;&#x6b;'+'<\/'+'a'+'>');
// -->
</script><noscript>&#x45;&#x6d;&#x61;&#x69;&#108;&#32;&#108;&#x69;&#110;&#x6b;&#32;&#40;&#110;&#x6f;&#98;&#x6f;&#100;&#x79;&#32;&#x61;&#116;&#32;&#110;&#x6f;&#x77;&#104;&#x65;&#114;&#x65;&#32;&#100;&#x6f;&#116;&#32;&#110;&#x65;&#116;&#x29;</noscript></p>
<p><a href="">Empty</a>.</p>