More incremental parser tests.

This commit is contained in:
Cyrus Najmabadi 2014-12-10 19:15:44 -08:00
parent 563b234240
commit ee828dc1da
2 changed files with 4 additions and 0 deletions

View File

@ -866,6 +866,7 @@ module ts {
filename: string;
text: string;
getLineAndCharacterFromPosition(position: number): LineAndCharacter;
getPositionFromLineAndCharacter(line: number, character: number): number;
getLineStarts(): number[];

View File

@ -67,6 +67,9 @@ module ts {
// There should be no reused nodes between two trees that are fully parsed.
assert.isTrue(reusedElements(oldTree, newTree) === 0);
assert.equal(newTree.filename, incrementalNewTree.filename, "newTree.filename !== incrementalNewTree.filename");
assert.equal(newTree.text, incrementalNewTree.text, "newTree.filename !== incrementalNewTree.filename");
if (expectedReusedElements !== -1) {
var actualReusedCount = reusedElements(oldTree, incrementalNewTree);
assert.equal(actualReusedCount, expectedReusedElements, actualReusedCount + " !== " + expectedReusedElements);