Diff options
Diffstat (limited to 'tests/extensions/test-about-render.lua')
| -rw-r--r-- | tests/extensions/test-about-render.lua | 10 |
1 file changed, 10 insertions, 0 deletions
diff --git a/tests/extensions/test-about-render.lua b/tests/extensions/test-about-render.lua index b9284c4..6f54805 100644 --- a/tests/extensions/test-about-render.lua +++ b/tests/extensions/test-about-render.lua @@ -86,6 +86,16 @@ h.contains("a repeated anchor is counted", out, "<h1 id='twice'>Twice</h1><h1 id out = render("README.md", "# About") h.contains("no heading takes an id of the page", out, "<h1 id='about-1'>") +out = render("README.md", "# Cgit\n# Header") +h.contains("nor any other id of the page", out, "<h1 id='cgit-1'>Cgit</h1><h1 id='header-1'>Header</h1>") + +out = render("README.md", "# Twice\n# Twice\n# Twice 1") +h.contains("a count never gives an anchor a heading already took", out, + "<h1 id='twice-1'>Twice</h1><h1 id='twice-1-1'>Twice 1</h1>") + +out = render("README.md", "# About\n# About 1") +h.contains("and the same holds past an id of the page", out, "<h1 id='about-1'>About</h1><h1 id='about-1-1'>About 1</h1>") + out = render("README.md", "# ???") h.contains("a heading of punctuation gets no anchor", out, "<h1>???</h1>") |
