diff --git a/test/Microsoft.AspNetCore.Razor.Test.Common/Langauge/IntegrationTests/RazorIRNodeVerifier.cs b/test/Microsoft.AspNetCore.Razor.Test.Common/Langauge/IntegrationTests/RazorIRNodeVerifier.cs index 6c290bd87d..3b34bb5ecb 100644 --- a/test/Microsoft.AspNetCore.Razor.Test.Common/Langauge/IntegrationTests/RazorIRNodeVerifier.cs +++ b/test/Microsoft.AspNetCore.Razor.Test.Common/Langauge/IntegrationTests/RazorIRNodeVerifier.cs @@ -16,6 +16,7 @@ namespace Microsoft.AspNetCore.Razor.Language.IntegrationTests { var walker = new Walker(baseline); walker.Visit(node); + walker.AssertReachedEndOfBaseline(); } private class Walker : RazorIRNodeWalker @@ -53,6 +54,12 @@ namespace Microsoft.AspNetCore.Razor.Language.IntegrationTests _visitor.Depth--; } + public void AssertReachedEndOfBaseline() + { + // Since we're walking the nodes of our generated code there's the chance that our baseline is longer. + Assert.True(_baseline.Length == _index, "Not all lines of the baseline were visited!"); + } + private void AssertNodeEquals(RazorIRNode node, string expected, string actual) { if (string.Equals(expected, actual))