Skip to content

Commit 580d0a6

Browse files
committed
More tests
1 parent 566e4fb commit 580d0a6

3 files changed

Lines changed: 49 additions & 0 deletions

File tree

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
/// <reference path="fourslash.ts"/>
2+
3+
//// for (var of in of) { }
4+
5+
var c = classification;
6+
verify.syntacticClassificationsAre(
7+
c.keyword("for"),
8+
c.punctuation("("),
9+
c.keyword("var"),
10+
c.text("of"),
11+
c.keyword("in"),
12+
c.text("of"),
13+
c.punctuation(")"),
14+
c.punctuation("{"),
15+
c.punctuation("}")
16+
);
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
/// <reference path="fourslash.ts"/>
2+
3+
//// for (var of; of; of) { }
4+
5+
var c = classification;
6+
verify.syntacticClassificationsAre(
7+
c.keyword("for"),
8+
c.punctuation("("),
9+
c.keyword("var"),
10+
c.text("of"),
11+
c.punctuation(";"),
12+
c.text("of"),
13+
c.punctuation(";"),
14+
c.text("of"),
15+
c.punctuation(")"),
16+
c.punctuation("{"),
17+
c.punctuation("}")
18+
);

tests/cases/unittests/services/colorization.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -430,5 +430,20 @@ class D { }\r\n\
430430
comment(">>>>>>> Branch - a"),
431431
finalEndOfLineState(ts.EndOfLineState.Start));
432432
});
433+
434+
it("'of' keyword", function () {
435+
testLexicalClassification("for (var of of of) { }",
436+
ts.EndOfLineState.Start,
437+
keyword("for"),
438+
punctuation("("),
439+
keyword("var"),
440+
keyword("of"),
441+
keyword("of"),
442+
keyword("of"),
443+
punctuation(")"),
444+
punctuation("{"),
445+
punctuation("}"),
446+
finalEndOfLineState(ts.EndOfLineState.Start));
447+
});
433448
});
434449
});

0 commit comments

Comments
 (0)