@@ -555,10 +555,47 @@ if all of its characters have syntax and face. See
555
555
(" Comment3" t haskell-literate-comment-face))
556
556
'literate ))
557
557
558
+ (ert-deftest haskell-type-instance ()
559
+ " Fontify \" instance\" after \" type\" "
560
+ ; ; Note that instance is always fontified, because it is a keyword even
561
+ ; ; without 'type' before it.
562
+ (check-properties
563
+ '(" type instance Foo Int = Char" )
564
+ '((" type" " w" haskell-keyword-face)
565
+ (" instance" " w" haskell-keyword-face))))
566
+
567
+ (ert-deftest haskell-type-family ()
568
+ " Fontify \" family\" after \" type\" "
569
+ (check-properties
570
+ '(" type family Foo a :: *" )
571
+ '((" type" " w" haskell-keyword-face)
572
+ (" family" " w" haskell-keyword-face))))
573
+
574
+ (ert-deftest haskell-data-family ()
575
+ " Fontify \" family\" after \" data\" "
576
+ (check-properties
577
+ '(" data family Foo a :: *" )
578
+ '((" data" " w" haskell-keyword-face)
579
+ (" family" " w" haskell-keyword-face))))
580
+
581
+ (ert-deftest haskell-no-family ()
582
+ " Don't fontify \" family\" when not after \" type\" or \" data\" "
583
+ (check-properties
584
+ '(" foo family = 10" )
585
+ '((" foo" " w" haskell-definition-face)
586
+ (" family" " w" nil ))))
587
+
558
588
(ert-deftest haskell-type-role ()
559
- " fontify \" role\" after \" type\" "
589
+ " Fontify \" role\" after \" type\" "
560
590
(check-properties
561
591
'(" type role Ptr representational" )
562
592
'((" type" " w" haskell-keyword-face)
563
593
(" role" " w" haskell-keyword-face)
564
594
(" Ptr" " w" haskell-constructor-face))))
595
+
596
+ (ert-deftest haskell-no-type-role ()
597
+ " Don't fontify \" role\" when not after \" type\" "
598
+ (check-properties
599
+ '(" foo role = 3" )
600
+ '((" foo" " w" haskell-definition-face)
601
+ (" role" " w" nil ))))
0 commit comments