diff options
authorBryce Kwon <bryce@brycekwon.com>
committerBryce Kwon <bryce@brycekwon.com>
commit
parent
tree
download
Find a script's lexer from its shebang line
Scintillua's detect reads the first line as well as the name, and without it hooks, bin scripts and anything else lacking an extension stayed plain.
Diffstat (limited to '')
-rw-r--r--tests/extensions/test-syntax-highlight.lua4
1 file changed, 4 insertions, 0 deletions
diff --git a/tests/extensions/test-syntax-highlight.lua b/tests/extensions/test-syntax-highlight.lua
index a9e8b36..a87cd80 100644
--- a/tests/extensions/test-syntax-highlight.lua
+++ b/tests/extensions/test-syntax-highlight.lua
@@ -60,6 +60,10 @@ h.equals("a lexer that raises falls back to escaped text", out, "some &lt;code&g
out = render("script.viadetect", "if")
h.equals("filename detection picks the lexer", out, "<span class='hl-keyword'>if</span>")
+out = render("post-receive", "#!/usr/bin/fake\nif")
+h.contains("a shebang picks the lexer of a file with no extension", 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;")