branch: elpa/jade-mode
commit f9522fc00a68ad0ecab30061eba0f988431d1c63
Author: Matthew Conway <[email protected]>
Commit: Matthew Conway <[email protected]>
reorder highlight tests to match regex order in jade-mode.el and display
word in ert should
---
test/highlight-test.el | 12 ++++++------
test/test-helper.el | 9 +++++++--
2 files changed, 13 insertions(+), 8 deletions(-)
diff --git a/test/highlight-test.el b/test/highlight-test.el
index 8d9c4aafa5..397faddbc3 100644
--- a/test/highlight-test.el
+++ b/test/highlight-test.el
@@ -13,13 +13,13 @@
(point-at-eol)))))
(ert-deftest jade-mode-highlights-in-isolation ()
- (jade-test-highlight-one-word "doctype html" 'font-lock-comment-face 0)
- (jade-test-highlight-one-word "head" 'font-lock-function-name-face 1)
- (jade-test-highlight-one-word "body" 'font-lock-function-name-face 2)
+ (jade-test-highlight-one-word "mixin" 'font-lock-keyword-face 2)
+
(jade-test-highlight-one-word "#container" 'font-lock-variable-name-face 2)
(jade-test-highlight-one-word ".class" 'font-lock-type-face 2)
- (jade-test-highlight-one-word "if" 'font-lock-keyword-face 2)
(jade-test-highlight-one-word "// this is a comment" 'font-lock-comment-face
2)
(jade-test-highlight-one-word "//- this is a comment"
'font-lock-comment-face 2)
- (jade-test-highlight-one-word "//- this is a comment"
'font-lock-comment-face 2)
- (jade-test-highlight-one-word "-// this is a comment"
'font-lock-comment-face 2))
+ (jade-test-highlight-one-word "-// this is a comment"
'font-lock-comment-face 2)
+ (jade-test-highlight-one-word "head" 'font-lock-function-name-face 0)
+ (jade-test-highlight-one-word "body" 'font-lock-function-name-face 2)
+ (jade-test-highlight-one-word "doctype html" 'font-lock-comment-face 0))
diff --git a/test/test-helper.el b/test/test-helper.el
index 84174d3eae..34a6c3f7a8 100644
--- a/test/test-helper.el
+++ b/test/test-helper.el
@@ -26,12 +26,17 @@
(and (eq (point) (point-max)) (goto-char (point-min)))
(search-forward string nil t 1))
+(defun jade-test--show-tested-text (text form)
+ form)
+
(defmacro jade-test-highlight-one-word (word face n)
`(jade-test-with-temp-buffer-pt-min
,(concat (s-repeat n "\t") word "\n\n")
(print (buffer-string))
- (should (eq (get-text-property
- ,(+ 1 n) 'face)
+ (should (eq (jade-test--show-tested-text
+ ,word
+ (get-text-property
+ ,(+ 1 n) 'face))
,face))
(goto-char ,(+ 1 n))
(should (eq