branch: elpa/lua-mode
commit ceb575baa5e1135ef03061afe054450ee0e9a438
Author: immerrr <[email protected]>
Commit: immerrr <[email protected]>
tests: break down function header tests into separate cases
---
test/test-font-lock.el | 15 ++++++++++++++-
1 file changed, 14 insertions(+), 1 deletion(-)
diff --git a/test/test-font-lock.el b/test/test-font-lock.el
index b89037d..f30b1fc 100644
--- a/test/test-font-lock.el
+++ b/test/test-font-lock.el
@@ -81,7 +81,20 @@ _table.sort(foobar)
(describe "Fontification of function headers"
- (it "fontifies simple headers"
+ (it "fontifies function <name>(...) headers"
+ (expect "function bar() end"
+ :to-be-fontified-as '(("function" keyword "bar" function-name
"end" keyword))))
+ (it "fontifies local function <name>(...) headers"
+ (expect "local function baz() end"
+ :to-be-fontified-as '(("local" keyword "function" keyword "baz"
function-name "end" keyword))))
+ (it "fontifies <name> = function (...) headers"
+ (expect "qux = function() end"
+ :to-be-fontified-as '(("qux" function-name "function" keyword
"end" keyword))))
+ (it "fontifies local <name> = function (...) headers"
+ (expect "local quux = function() end"
+ :to-be-fontified-as '(("local" keyword "quux" function-name
"function" keyword "end" keyword))))
+
+ (it "fontifies different variations of headers altogether"
(expect
;; Check all defun variants, check embedded defuns
"\