Browse Source

[Tests] Added test case for a parser bug.

newNRvisualizers
mike 13 years ago committed by mike
parent
commit
7d89302a83
  1. 30
      ICSharpCode.NRefactory.Tests/CSharp/Parser/Bugs/ParserBugTests.cs

30
ICSharpCode.NRefactory.Tests/CSharp/Parser/Bugs/ParserBugTests.cs

@ -348,6 +348,36 @@ class Foo @@ -348,6 +348,36 @@ class Foo
Assert.IsTrue(passed);
}
/// <summary>
/// Bug 5064 - Autocomplete doesn't include object initializer properties in yield return
/// </summary>
[Ignore("Still open")]
[Test]
public void TestBug5064()
{
string code =
@"public class Bar
{
public IEnumerable<Foo> GetFoos()
{
yield return new Foo { }
}
}";
var unit = CompilationUnit.Parse(code);
bool passed = unit.GetText().Trim() == @"public class Bar
{
public IEnumerable<Foo> GetFoos()
{
yield return new Foo { };
}
}";
if (!passed) {
Console.WriteLine("Expected:" + code);
Console.WriteLine("Was:" + unit.GetText());
}
Assert.IsTrue(passed);
}
}
}

Loading…
Cancel
Save