Skip to content

Commit c719100

Browse files
Added test cases for multiline comments in line classification.
1 parent 4493aa6 commit c719100

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

tests/cases/unittests/services/colorization.ts

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,27 @@ describe('Colorization', function () {
155155
finalEndOfLineState(ts.EndOfLineState.InMultiLineCommentTrivia));
156156
});
157157

158+
it("correctly classifies the termination of a multiline comment", function () {
159+
test(" */ ",
160+
ts.EndOfLineState.InMultiLineCommentTrivia,
161+
comment(" */"),
162+
finalEndOfLineState(ts.EndOfLineState.Start));
163+
});
164+
165+
it("correctly classifies the continuation of a multiline comment", function () {
166+
test("LOREM IPSUM DOLOR ",
167+
ts.EndOfLineState.InMultiLineCommentTrivia,
168+
comment("LOREM IPSUM DOLOR "),
169+
finalEndOfLineState(ts.EndOfLineState.InMultiLineCommentTrivia));
170+
});
171+
172+
it("correctly classifies an unterminated multiline comment on a line ending in '/*/'", function () {
173+
test(" /*/",
174+
ts.EndOfLineState.Start,
175+
comment("/*/"),
176+
finalEndOfLineState(ts.EndOfLineState.InMultiLineCommentTrivia));
177+
});
178+
158179
it("classifies correctly an unterminated multiline comment with trailing space", function () {
159180
test("/* ",
160181
ts.EndOfLineState.Start,

0 commit comments

Comments
 (0)