Skip to content

Commit ad73e8f

Browse files
committed
Test '{type|data} family' font-locking (#1056)
1 parent 0d71b39 commit ad73e8f

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

tests/haskell-font-lock-tests.el

+21
Original file line numberDiff line numberDiff line change
@@ -555,6 +555,27 @@ if all of its characters have syntax and face. See
555555
("Comment3" t haskell-literate-comment-face))
556556
'literate))
557557

558+
(ert-deftest haskell-type-family ()
559+
"Fontify \"family\" after \"type\""
560+
(check-properties
561+
'("type family Foo a :: *")
562+
'(("type" "w" haskell-keyword-face)
563+
("family" "w" haskell-keyword-face))))
564+
565+
(ert-deftest haskell-data-family ()
566+
"Fontify \"family\" after \"data\""
567+
(check-properties
568+
'("data family Foo a :: *")
569+
'(("data" "w" haskell-keyword-face)
570+
("family" "w" haskell-keyword-face))))
571+
572+
(ert-deftest haskell-no-family ()
573+
"Don't fontify \"family\" when not after \"type\" or \"data\""
574+
(check-properties
575+
'("foo family = 10")
576+
'(("foo" "w" haskell-definition-face)
577+
("family" "w" nil))))
578+
558579
(ert-deftest haskell-type-role ()
559580
"Fontify \"role\" after \"type\""
560581
(check-properties

0 commit comments

Comments
 (0)