3rdparty/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/Parser/Bugs/ParserBugTests.cs
/// <summary>
/// Bug 4058 - Unattached parameter attributes should be included in the AST
/// </summary>
Bug 4058 - Unattached parameter attributes should be included in the AST
Bug 4058 - Unattached parameter attributes should be included in the AST
[Test]
		public void TestBug4058()
		{
			string code = @"
class TestClass
{
  TestClass([attr])
  {
  }
}";
			var unit = SyntaxTree.Parse(code);
			var type = unit.Members.First() as TypeDeclaration;
			var constructor = type.Members.First() as ConstructorDeclaration;
			bool passed = constructor.GetNodeAt<AttributeSection>(constructor.LParToken.StartLocation.Line, constructor.LParToken.StartLocation.Column + 1) != null;
			if (!passed) {
				Console.WriteLine("Expected:" + code);
				Console.WriteLine("Was:" + unit);
			}
			Assert.IsTrue(passed);
		}
[ Test ] public void TestBug4058 ( ) { string code = @"
class TestClass
{
  TestClass([attr])
  {
  }
}" ; var unit = SyntaxTree . Parse ( code ) ; var type = unit . Members . First ( ) as TypeDeclaration ; var constructor = type . Members . First ( ) as ConstructorDeclaration ; bool passed = constructor . GetNodeAt < AttributeSection > ( constructor . LParToken . StartLocation . Line , constructor . LParToken . StartLocation . Column + 1 ) != null ; if ( ! passed ) { Console . WriteLine ( " " + code ) ; Console . WriteLine ( " " + unit ) ; } Assert . IsTrue ( passed ) ; }
Bug 4058 - Unattached parameter attributes should be included in the AST
Bug 4058 - Unattached parameter attributes should be included in the AST