From eb3915bd92434437941300a299dceba54c7e9ffa Mon Sep 17 00:00:00 2001 From: Siegfried Pammer Date: Sun, 3 Oct 2010 16:57:33 +0200 Subject: [PATCH] improve LocationAssignmentCheckVisitor - does not check CompilationUnit, TypeReference and INullables that have IsNull == true --- .../Test/Parser/LocationAssignmentCheckVisitor.cs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/Libraries/NRefactory/Test/Parser/LocationAssignmentCheckVisitor.cs b/src/Libraries/NRefactory/Test/Parser/LocationAssignmentCheckVisitor.cs index d75d158d15..8c7944e8a8 100644 --- a/src/Libraries/NRefactory/Test/Parser/LocationAssignmentCheckVisitor.cs +++ b/src/Libraries/NRefactory/Test/Parser/LocationAssignmentCheckVisitor.cs @@ -12,8 +12,15 @@ namespace ICSharpCode.NRefactory.Tests.Ast { protected override void BeginVisit(INode node) { - Assert.IsFalse(node.StartLocation.IsEmpty); - Assert.IsFalse(node.EndLocation.IsEmpty); + if (node is CompilationUnit) + return; + if (node is INullable && ((INullable)node).IsNull) + return; + if (node is TypeReference) + return; + + Assert.IsFalse(node.StartLocation.IsEmpty, "StartLocation of {0}", node); + Assert.IsFalse(node.EndLocation.IsEmpty, "EndLocation of {0}", node); } } }