Skip to content

Commit b2372c9

Browse files
Fixed up colorization tests.
1 parent 5a33707 commit b2372c9

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

tests/cases/unittests/services/colorization.ts

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ describe('Colorization', function () {
3636
}
3737
var finalEndOfLineState = classResult[classResult.length - 1];
3838

39-
assert.equal(position, code.length, "Expected accumilative length of all entries to match the length of the source. expected: " + code.length + ", but got: " + position);
39+
assert.equal(position, code.length, "Expected cumulative length of all entries to match the length of the source. expected: " + code.length + ", but got: " + position);
4040

4141
return {
4242
tuples: tuples,
@@ -84,8 +84,8 @@ describe('Colorization', function () {
8484
var actualEntry = getEntryAtPosistion(result, actualEntryPosition);
8585

8686
assert(actualEntry, "Could not find classification entry for '" + expectedEntry.value + "' at position: " + actualEntryPosition);
87-
assert.equal(actualEntry.length, expectedEntry.value.length, "Classification class does not match expected.");
88-
assert.equal(actualEntry.class, expectedEntry.class, "Classification class does not match expected.");
87+
assert.equal(actualEntry.class, expectedEntry.class, "Classification class does not match expected. Expected: " + ts.TokenClass[expectedEntry.class] + ", Actual: " + ts.TokenClass[actualEntry.class]);
88+
assert.equal(actualEntry.length, expectedEntry.value.length, "Classification length does not match expected. Expected: " + ts.TokenClass[expectedEntry.value.length] + ", Actual: " + ts.TokenClass[actualEntry.length]);
8989
}
9090
}
9191
}
@@ -105,7 +105,7 @@ describe('Colorization', function () {
105105
punctuation(";"));
106106
});
107107

108-
it("classifies correctelly a comment after a divide operator", function () {
108+
it("classifies correctly a comment after a divide operator", function () {
109109
test("1 / 2 // comment",
110110
ts.EndOfLineState.Start,
111111
numberLiteral("1"),
@@ -115,7 +115,7 @@ describe('Colorization', function () {
115115
comment("// comment"));
116116
});
117117

118-
it("classifies correctelly a literal after a divide operator", function () {
118+
it("classifies correctly a literal after a divide operator", function () {
119119
test("1 / 2, 3 / 4",
120120
ts.EndOfLineState.Start,
121121
numberLiteral("1"),
@@ -127,42 +127,42 @@ describe('Colorization', function () {
127127
operator(","));
128128
});
129129

130-
it("classifies correctelly an unterminated multi-line string", function () {
130+
it("classifies correctly an unterminated multi-line string", function () {
131131
test("'line1\\",
132132
ts.EndOfLineState.Start,
133133
stringLiteral("'line1\\"),
134134
finalEndOfLineState(ts.EndOfLineState.InSingleQuoteStringLiteral));
135135
});
136136

137-
it("classifies correctelly the second line of an unterminated multi-line string", function () {
137+
it("classifies correctly the second line of an unterminated multi-line string", function () {
138138
test("\\",
139139
ts.EndOfLineState.InDoubleQuoteStringLiteral,
140140
stringLiteral("\\"),
141141
finalEndOfLineState(ts.EndOfLineState.InDoubleQuoteStringLiteral));
142142
});
143143

144-
it("classifies correctelly the last line of a multi-line string", function () {
144+
it("classifies correctly the last line of a multi-line string", function () {
145145
test("'",
146146
ts.EndOfLineState.InSingleQuoteStringLiteral,
147147
stringLiteral("'"),
148148
finalEndOfLineState(ts.EndOfLineState.Start));
149149
});
150150

151-
it("classifies correctelly an unterminated multiline comment", function () {
151+
it("classifies correctly an unterminated multiline comment", function () {
152152
test("/*",
153153
ts.EndOfLineState.Start,
154154
comment("/*"),
155155
finalEndOfLineState(ts.EndOfLineState.InMultiLineCommentTrivia));
156156
});
157157

158-
it("classifies correctelly an unterminated multiline comment with trailing space", function () {
158+
it("classifies correctly an unterminated multiline comment with trailing space", function () {
159159
test("/* ",
160160
ts.EndOfLineState.Start,
161161
comment("/* "),
162162
finalEndOfLineState(ts.EndOfLineState.InMultiLineCommentTrivia));
163163
});
164164

165-
it("classifies correctelly a keyword after a dot", function () {
165+
it("classifies correctly a keyword after a dot", function () {
166166
test("a.var",
167167
ts.EndOfLineState.Start,
168168
identifier("var"));

0 commit comments

Comments
 (0)