Skip to content

Commit

Permalink
Add failing parser test for icsharpcode#73.
Browse files Browse the repository at this point in the history
  • Loading branch information
dgrunwald committed Nov 6, 2013
1 parent 20b313d commit bf08a76
Showing 1 changed file with 15 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -257,5 +257,20 @@ public void AssemblyAttributeBeforeClass()
}, syntaxTree.Children.Select(c => c.GetType()).ToArray());
Assert.That(((TypeDeclaration)syntaxTree.LastChild).Attributes, Is.Empty);
}

[Test, Ignore("parser bug; see https://github.com/icsharpcode/NRefactory/pull/73")]
public void AssemblyAndModuleAttributeBeforeClass()
{
// See also: TypeSystemConvertVisitorTests.AssemblyAndModuleAttributesDoNotAppearOnTypes
var syntaxTree = SyntaxTree.Parse("[assembly: My1][module: My2][My3]class C {}");
Assert.AreEqual(
new Type[] {
typeof(AttributeSection),
typeof(AttributeSection),
typeof(TypeDeclaration)
}, syntaxTree.Children.Select(c => c.GetType()).ToArray());
var td = (TypeDeclaration)syntaxTree.LastChild;
Assert.AreEqual(1, td.Attributes.Count);
}
}
}

0 comments on commit bf08a76

Please sign in to comment.