mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-15 12:51:30 -05:00
Add incremental test.
This commit is contained in:
@@ -315,5 +315,18 @@ module ts {
|
||||
|
||||
compareTrees(oldText, newTextAndChange.text, newTextAndChange.textChangeRange, 0);
|
||||
});
|
||||
|
||||
it('Strict mode 4',() => {
|
||||
// In non-strict mode 'package' means nothing and can be reused. In strict mode though
|
||||
// we'll have to reparse the nodes (and generate an error for 'package();'
|
||||
var source = "'use strict';\r\nfoo1();\r\nfoo1();\r\nfoo1();\r\npackage();";
|
||||
|
||||
var index = source.indexOf('f');
|
||||
var oldText = ScriptSnapshot.fromString(source);
|
||||
var newTextAndChange = withDelete(oldText, 0, index);
|
||||
|
||||
// Note the decreased reuse of nodes compared to testStrictMode3
|
||||
compareTrees(oldText, newTextAndChange.text, newTextAndChange.textChangeRange, 0);
|
||||
});
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user