Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 4f78695

Browse files
committed
Respond to code review comments
1 parent 82bc914 commit 4f78695

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

Jakefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ var harnessSources = [
144144
"services/documentRegistry.ts",
145145
"services/preProcessFile.ts",
146146
"services/patternMatcher.ts",
147-
"versionCache.ts"
147+
"versionCache.ts"
148148
].map(function (f) {
149149
return path.join(unittestsDirectory, f);
150150
})).concat([

tests/cases/unittests/versionCache.ts

+8-8
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ and grew 1cm per day`;
159159
});
160160

161161
describe('VersionCache stress test', () => {
162-
const interationCount = 20;
162+
const iterationCount = 20;
163163
//const interationCount = 20000; // uncomment for testing
164164

165165
// Use scanner.ts, decent size, does not change frequentlly
@@ -205,23 +205,23 @@ and grew 1cm per day`;
205205
}
206206

207207
it("Range (average length 1/4 file size)", () => {
208-
for (let i = 0; i < interationCount; i++) {
208+
for (let i = 0; i < iterationCount; i++) {
209209
let s2 = lineIndex.getText(rsa[i], la[i]);
210210
let s1 = testContent.substring(rsa[i], rsa[i] + la[i]);
211211
assert.equal(s1, s2);
212212
}
213213
});
214214

215215
it("Range (average length 4 chars)", () => {
216-
for (let j = 0; j < interationCount; j++) {
216+
for (let j = 0; j < iterationCount; j++) {
217217
let s2 = lineIndex.getText(rsa[j], las[j]);
218218
let s1 = testContent.substring(rsa[j], rsa[j] + las[j]);
219219
assert.equal(s1, s2);
220220
}
221221
});
222222

223223
it("Edit (average length 4)", () => {
224-
for (let i = 0; i < interationCount; i++) {
224+
for (let i = 0; i < iterationCount; i++) {
225225
let insertString = testContent.substring(rsa[100000 - i], rsa[100000 - i] + las[100000 - i]);
226226
let snapshot = lineIndex.edit(rsa[i], las[i], insertString);
227227
let checkText = editFlat(rsa[i], las[i], insertString, testContent);
@@ -234,7 +234,7 @@ and grew 1cm per day`;
234234
let svc = server.ScriptVersionCache.fromString(testContent);
235235
let checkText = testContent;
236236

237-
for (let i = 0; i < interationCount; i++) {
237+
for (let i = 0; i < iterationCount; i++) {
238238
let insertString = testContent.substring(rsa[i], rsa[i] + las[i]);
239239
svc.edit(ersa[i], elas[i], insertString);
240240
checkText = editFlat(ersa[i], elas[i], insertString, checkText);
@@ -247,7 +247,7 @@ and grew 1cm per day`;
247247
});
248248

249249
it("Edit (average length 1/4th file size)", () => {
250-
for (let i = 0; i < interationCount; i++) {
250+
for (let i = 0; i < iterationCount; i++) {
251251
let insertString = testContent.substring(rsa[100000 - i], rsa[100000 - i] + la[100000 - i]);
252252
let snapshot = lineIndex.edit(rsa[i], la[i], insertString);
253253
let checkText = editFlat(rsa[i], la[i], insertString, testContent);
@@ -257,7 +257,7 @@ and grew 1cm per day`;
257257
});
258258

259259
it("Line/offset from pos", () => {
260-
for (let i = 0; i < interationCount; i++) {
260+
for (let i = 0; i < iterationCount; i++) {
261261
let lp = lineIndex.charOffsetToLineNumberAndPos(rsa[i]);
262262
let lac = ts.computeLineAndCharacterOfPosition(lineMap, rsa[i]);
263263
assert.equal(lac.line + 1, lp.line, "Line number mismatch " + (lac.line + 1) + " " + lp.line + " " + i);
@@ -266,7 +266,7 @@ and grew 1cm per day`;
266266
});
267267

268268
it("Start pos from line", () => {
269-
for (let i = 0; i < interationCount; i++) {
269+
for (let i = 0; i < iterationCount; i++) {
270270
for (let j = 0, llen = lines.length; j < llen; j++) {
271271
let lineInfo = lineIndex.lineNumberToInfo(j + 1);
272272
let lineIndexOffset = lineInfo.offset;

0 commit comments

Comments
 (0)