Skip to content

Commit e0e33fd

Browse files
committed
Test comments highlighting
1 parent 4936470 commit e0e33fd

File tree

1 file changed

+55
-0
lines changed

1 file changed

+55
-0
lines changed

tests/purescript-font-lock-tests.el

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,3 +99,58 @@ this = \"still a string\"
9999
'((1 3 font-lock-function-name-face)
100100
(5 5 font-lock-variable-name-face)
101101
(7 37 font-lock-string-face))))
102+
103+
(ert-deftest docs-bar-comment-different-spacings ()
104+
(purescript-test-ranges
105+
"-- | Docs comment space
106+
-- | Docs comment many spaces
107+
"
108+
'((1 57 font-lock-doc-face))))
109+
110+
(ert-deftest docs-bar-comment-continuation ()
111+
"Acc. to
112+
https://github.com/purescript/documentation/blob/master/language/Syntax.md
113+
PureScript explicitly doesn't support Haskell-style docs continuation
114+
where vertical bar is omitted"
115+
:expected-result :failed
116+
(purescript-test-ranges
117+
"-- | Docs start
118+
-- continue
119+
"
120+
'((1 16 font-lock-doc-face)
121+
(17 19 font-lock-comment-delimiter-face)
122+
(20 28 font-lock-comment-face))))
123+
124+
(ert-deftest docs-cap-comment-different-spacings ()
125+
(purescript-test-ranges
126+
"-- ^ Docs comment space
127+
-- ^ Docs comment many spaces
128+
"
129+
'((1 57 font-lock-doc-face))))
130+
131+
(ert-deftest multiline-comment ()
132+
(purescript-test-ranges
133+
"{-
134+
multiline comment
135+
-- | not a doc
136+
--| not a doc
137+
still comment
138+
-}
139+
noncomment
140+
{--}
141+
noncomment
142+
"
143+
'((1 64 font-lock-comment-face)
144+
(65 66 font-lock-comment-delimiter-face)
145+
(67 78 nil)
146+
(79 80 font-lock-comment-face)
147+
(81 82 font-lock-comment-delimiter-face)
148+
(83 93 nil))))
149+
150+
(ert-deftest multiline-comment-w-delimiter-inside ()
151+
:expected-result :failed
152+
(purescript-test-ranges
153+
"{- {-{- -} noncomment"
154+
'((1 6 font-lock-comment-face)
155+
(7 10 font-lock-comment-delimiter-face)
156+
(11 21 nil))))

0 commit comments

Comments
 (0)