3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/Parser/Bugs/ParserBugTests.cs
/// <summary>
/// Bug 4556 - AST broken for unclosed invocation
/// </summary>
Bug 4556 - AST broken for unclosed invocation
Bug 4556 - AST broken for unclosed invocation
[Test]
		public void TestBug4556()
		{
			string code = 
@"using System;
class Foo
{
    public static void Main (string[] args)
    {
        Console.WriteLine (""foo"", 
    }
}
";
			var unit = SyntaxTree.Parse(code);
			var type = unit.Members.First(m => m is TypeDeclaration) as TypeDeclaration;
			var method = type.Members.First() as MethodDeclaration;
			bool passed = !method.Body.IsNull;
			if (!passed) {
				Console.WriteLine("Expected:" + code);
				Console.WriteLine("Was:" + unit);
			}
			Assert.IsTrue(passed);
		}
[ Test ] public void TestBug4556 ( ) { string code = @"using System;

class Foo
{
    public static void Main (string[] args)
    {
        Console.WriteLine (""foo"", 
    }
}
" ; var unit = SyntaxTree . Parse ( code ) ; var type = unit . Members . First ( m => m is TypeDeclaration ) as TypeDeclaration ; var method = type . Members . First ( ) as MethodDeclaration ; bool passed = ! method . Body . IsNull ; if ( ! passed ) { Console . WriteLine ( " " + code ) ; Console . WriteLine ( " " + unit ) ; } Assert . IsTrue ( passed ) ; }
Bug 4556 - AST broken for unclosed invocation
Bug 4556 - AST broken for unclosed invocation