branch: elpa/swift-mode commit fc009b535f6c10e58878e27cfe6c04c41402eb06 Author: Chris Barrett <chris.d.barr...@me.com> Commit: Chris Barrett <chris.d.barr...@me.com>
Add font locking for indentation tests --- test/indentation-tests.el | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/test/indentation-tests.el b/test/indentation-tests.el index 6c24edd..19b2e59 100644 --- a/test/indentation-tests.el +++ b/test/indentation-tests.el @@ -30,6 +30,8 @@ (require 'swift-mode) (require 's) +;;; Test utilities + (defmacro check-indentation (description before after &optional var-bindings) "Declare an ert test for indentation behaviour. The test will check that the swift indentation command changes the buffer @@ -68,6 +70,23 @@ values of customisable variables." (should (equal expected-state (buffer-string))) (should (equal expected-cursor-pos (point)))))))) +;; Provide font locking for easier test editing. + +(font-lock-add-keywords + 'emacs-lisp-mode + `((,(rx "(" (group "check-indentation") eow) + (1 font-lock-keyword-face)) + (,(rx "(" + (group "check-indentation") (+ space) + (group bow (+ (not space)) eow) + ) + (1 font-lock-keyword-face) + (2 font-lock-function-name-face)))) + + +;;; Tests + + (check-indentation no-indentation-at-top-level "|x" "|x")