Skip to content

Commit f9522fc

Browse files
reorder highlight tests to match regex order in jade-mode.el and display
word in ert should
1 parent 2417d49 commit f9522fc

File tree

2 files changed

+13
-8
lines changed

2 files changed

+13
-8
lines changed

test/highlight-test.el

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,13 @@
1313
(point-at-eol)))))
1414

1515
(ert-deftest jade-mode-highlights-in-isolation ()
16-
(jade-test-highlight-one-word "doctype html" 'font-lock-comment-face 0)
17-
(jade-test-highlight-one-word "head" 'font-lock-function-name-face 1)
18-
(jade-test-highlight-one-word "body" 'font-lock-function-name-face 2)
16+
(jade-test-highlight-one-word "mixin" 'font-lock-keyword-face 2)
17+
1918
(jade-test-highlight-one-word "#container" 'font-lock-variable-name-face 2)
2019
(jade-test-highlight-one-word ".class" 'font-lock-type-face 2)
21-
(jade-test-highlight-one-word "if" 'font-lock-keyword-face 2)
2220
(jade-test-highlight-one-word "// this is a comment" 'font-lock-comment-face 2)
2321
(jade-test-highlight-one-word "//- this is a comment" 'font-lock-comment-face 2)
24-
(jade-test-highlight-one-word "//- this is a comment" 'font-lock-comment-face 2)
25-
(jade-test-highlight-one-word "-// this is a comment" 'font-lock-comment-face 2))
22+
(jade-test-highlight-one-word "-// this is a comment" 'font-lock-comment-face 2)
23+
(jade-test-highlight-one-word "head" 'font-lock-function-name-face 0)
24+
(jade-test-highlight-one-word "body" 'font-lock-function-name-face 2)
25+
(jade-test-highlight-one-word "doctype html" 'font-lock-comment-face 0))

test/test-helper.el

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,17 @@
2626
(and (eq (point) (point-max)) (goto-char (point-min)))
2727
(search-forward string nil t 1))
2828

29+
(defun jade-test--show-tested-text (text form)
30+
form)
31+
2932
(defmacro jade-test-highlight-one-word (word face n)
3033
`(jade-test-with-temp-buffer-pt-min
3134
,(concat (s-repeat n "\t") word "\n\n")
3235
(print (buffer-string))
33-
(should (eq (get-text-property
34-
,(+ 1 n) 'face)
36+
(should (eq (jade-test--show-tested-text
37+
,word
38+
(get-text-property
39+
,(+ 1 n) 'face))
3540
,face))
3641
(goto-char ,(+ 1 n))
3742
(should (eq

0 commit comments

Comments
 (0)