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 338949a..b0379b7 100644 --- a/tests/extensions/test-about-render.lua +++ b/tests/extensions/test-about-render.lua @@ -73,6 +73,9 @@ h.contains("a heading renders inside the wrapper", out, "<div class='markdown'>< out = render("README.md", "## Sub ##") h.contains("trailing hashes are stripped from a heading", out, "<h2>Sub</h2>") +out = render("README.md", "# C#") +h.contains("a hash ending a word stays in the heading", out, "<h1>C#</h1>") + out = render("README.MD", "# Upper") h.contains("the extension matches whatever its case", out, "<h1>Upper</h1>") @@ -160,6 +163,13 @@ h.contains("the innermost text still renders", out, "x") out = render("README.md", string.rep("*a", 200)) h.check("an emphasis bomb still renders something", #out > 0) +-- Trimming a run of spaces must stay linear, or one hostile line holds a +-- request for minutes. Both lines below took seconds before. +local started = os.clock() +render("README.md", "# a" .. string.rep(" ", 3000) .. "b") +render("README.md", "| a | b |\n|---|---|\n| x" .. string.rep(" ", 40000) .. "y | z |") +h.check("a long run of spaces is trimmed quickly", os.clock() - started < 1) + out = render("README.md", "| a | b |\n| --- | --- |\n| 1 | 2 |") h.contains("a pipe table renders its head", out, "<thead><tr><th>a</th><th>b</th></tr></thead>") h.contains("a pipe table renders its body", out, "<tbody><tr><td>1</td><td>2</td></tr></tbody>") |
