diff options
context:
space:
mode:
Diffstat (limited to 'tests/extensions/test-syntax-highlight.lua')
-rw-r--r--tests/extensions/test-syntax-highlight.lua33
1 file changed, 11 insertions, 22 deletions
diff --git a/tests/extensions/test-syntax-highlight.lua b/tests/extensions/test-syntax-highlight.lua
index 3b0eeb8..a9e8b36 100644
--- a/tests/extensions/test-syntax-highlight.lua
+++ b/tests/extensions/test-syntax-highlight.lua
@@ -31,51 +31,40 @@ if mode == "nolexers" then
-- put the line numbers beside it out of step, so the whole escaped
-- blob has to come back intact across several slices.
out = render("big.fake", string.rep("x<y>", 30000))
- h.equals("slicing loses nothing at the boundaries", out,
- string.rep("x&lt;y&gt;", 30000))
+ h.equals("slicing loses nothing at the boundaries", out, string.rep("x&lt;y&gt;", 30000))
h.finish()
end
local out, ret = render("hello.fake", "if 42 'hi' & zz")
-h.contains("keywords are wrapped in their class", out,
- "<span class='hl-keyword'>if</span>")
-h.contains("numbers are wrapped in their class", out,
- "<span class='hl-number'>42</span>")
-h.contains("a dotted tag maps by its first component", out,
- "<span class='hl-string'>'hi'</span>")
+h.contains("keywords are wrapped in their class", out, "<span class='hl-keyword'>if</span>")
+h.contains("numbers are wrapped in their class", out, "<span class='hl-number'>42</span>")
+h.contains("a dotted tag maps by its first component", out, "<span class='hl-string'>'hi'</span>")
h.contains("bytes between tokens are escaped", out, " &amp; ")
-h.contains("later tokens still highlight", out,
- "<span class='hl-keyword'>zz</span>")
+h.contains("later tokens still highlight", out, "<span class='hl-keyword'>zz</span>")
h.equals("close answers zero", ret, 0)
out = h.run({ "split.fake" }, { "i", "f" })
-h.equals("writes are joined before lexing", out,
- "<span class='hl-keyword'>if</span>")
+h.equals("writes are joined before lexing", out, "<span class='hl-keyword'>if</span>")
-- The short lexer tags four bytes and stops, and every byte after it still
-- has to reach the page.
out = render("cut.short", "abcd<ef>")
-h.equals("a lexer stopping early leaves an escaped tail", out,
- "<span class='hl-keyword'>abcd</span>&lt;ef&gt;")
+h.equals("a lexer stopping early leaves an escaped tail", out, "<span class='hl-keyword'>abcd</span>&lt;ef&gt;")
out = render("boom.badlex", "some <code>")
-h.equals("a lexer that raises falls back to escaped text", out,
- "some &lt;code&gt;")
+h.equals("a lexer that raises falls back to escaped text", out, "some &lt;code&gt;")
-- The viadetect lexer name only resolves through detect(), so highlighted
-- output proves the detection path ran ahead of the extension path.
out = render("script.viadetect", "if")
-h.equals("filename detection picks the lexer", out,
- "<span class='hl-keyword'>if</span>")
+h.equals("filename detection picks the lexer", out, "<span class='hl-keyword'>if</span>")
out = render("tool.py", "import <x>")
-h.equals("an extension with no lexer serves escaped text", out,
- "import &lt;x&gt;")
+h.equals("an extension with no lexer serves escaped text", out, "import &lt;x&gt;")
out = render("noextension", "words <here>")
-h.equals("a file with no extension serves escaped text", out,
- "words &lt;here&gt;")
+h.equals("a file with no extension serves escaped text", out, "words &lt;here&gt;")
out = render("big.fake", string.rep("a", 512 * 1024 + 1))
h.excludes("an oversized blob skips the lexing pass", out, "<span")