Skip to content

Commit 97232bc

Browse files
committed
Test comments highlighting
1 parent 4936470 commit 97232bc

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed

tests/purescript-font-lock-tests.el

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,3 +99,43 @@ 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+
{-
138+
still comment
139+
-}
140+
"
141+
'((1 70 font-lock-comment-face))))

0 commit comments

Comments
 (0)