Skip to content

Commit bae6ddd

Browse files
committed
add unterminated multiline comment classification tests
1 parent 38cacc9 commit bae6ddd

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

tests/cases/unittests/services/colorization.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,4 +191,22 @@ describe('Colorization', function () {
191191
assert.equal(results.finalEndOfLineState, ts.EndOfLineState.Start);
192192
});
193193
});
194+
195+
describe("test cases for colorizing unterminted multi-line comment", function () {
196+
it("unterminated multi-line comment correctelly", function () {
197+
var results = getClassifications("/*", ts.EndOfLineState.Start);
198+
199+
assert.equal(results.tuples.length, 1);
200+
verifyClassification(results.tuples[0], 2, ts.TokenClass.Comment);
201+
assert.equal(results.finalEndOfLineState, ts.EndOfLineState.InMultiLineCommentTrivia);
202+
});
203+
204+
it("unterminated multi-line comment with trailing space correctelly", function () {
205+
var results = getClassifications("/* ", ts.EndOfLineState.Start);
206+
207+
assert.equal(results.tuples.length, 1);
208+
verifyClassification(results.tuples[0], 3, ts.TokenClass.Comment);
209+
assert.equal(results.finalEndOfLineState, ts.EndOfLineState.InMultiLineCommentTrivia);
210+
});
211+
});
194212
});

0 commit comments

Comments
 (0)