From 2a845726ab51878dfc14f0d5aa5ce8aa61e90b6f Mon Sep 17 00:00:00 2001 From: Cyrus Najmabadi Date: Tue, 9 Dec 2014 18:36:32 -0800 Subject: [PATCH] Add incremental test. --- tests/cases/unittests/incrementalParser.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tests/cases/unittests/incrementalParser.ts b/tests/cases/unittests/incrementalParser.ts index 49607ed68d4..e1b4fa0f00f 100644 --- a/tests/cases/unittests/incrementalParser.ts +++ b/tests/cases/unittests/incrementalParser.ts @@ -691,6 +691,18 @@ module m3 { }\ compareTrees(oldText, newTextAndChange.text, newTextAndChange.textChangeRange, 0); }); + it('Unterminated comment after keyword converted to identifier',() => { + // 'public' as a keyword should be incrementally unusable (because it has an + // unterminated comment). When we convert it to an identifier, that shouldn't + // change anything, and we should still get the same errors. + var source = "return; a.public /*" + + var oldText = ScriptSnapshot.fromString(source); + var newTextAndChange = withInsert(oldText, 0, ""); + + compareTrees(oldText, newTextAndChange.text, newTextAndChange.textChangeRange, 0); + }); + // Simulated typing tests. it('Type extends clause 1',() => {