Skip to content

Commit 40e95d9

Browse files
Update test
1 parent 91391d0 commit 40e95d9

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

src/Compilers/CSharp/Test/Syntax/IncrementalParsing/IncrementalParsingTests.cs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3680,14 +3680,24 @@ void Main()
36803680
var tree = SyntaxFactory.ParseSyntaxTree(source);
36813681
var text = tree.GetText();
36823682

3683+
// Update all the 'i's in the for-loop to be 'in' instead.
36833684
var position1 = source.IndexOf("i =") + 1;
36843685
var position2 = source.IndexOf("i <") + 1;
36853686
var position3 = source.IndexOf("i++") + 1;
3686-
36873687
text = text.WithChanges(
36883688
new TextChange(new TextSpan(position1, 0), "n"),
36893689
new TextChange(new TextSpan(position2, 0), "n"),
36903690
new TextChange(new TextSpan(position3, 0), "n"));
3691+
3692+
Assert.Equal("""
3693+
void Main()
3694+
{
3695+
for (int in = 0; in < n; in++)
3696+
{
3697+
}
3698+
}
3699+
""", text.ToString());
3700+
36913701
tree = tree.WithChangedText(text);
36923702
var fullTree = SyntaxFactory.ParseSyntaxTree(text.ToString());
36933703
WalkTreeAndVerify(tree.GetCompilationUnitRoot(), fullTree.GetCompilationUnitRoot());

0 commit comments

Comments
 (0)