Fail if baseline longer than generated
This commit is contained in:
parent
f0d0c3d0b8
commit
dc66eabbff
|
|
@ -16,6 +16,7 @@ namespace Microsoft.AspNetCore.Razor.Language.IntegrationTests
|
||||||
{
|
{
|
||||||
var walker = new Walker(baseline);
|
var walker = new Walker(baseline);
|
||||||
walker.Visit(node);
|
walker.Visit(node);
|
||||||
|
walker.AssertReachedEndOfBaseline();
|
||||||
}
|
}
|
||||||
|
|
||||||
private class Walker : RazorIRNodeWalker
|
private class Walker : RazorIRNodeWalker
|
||||||
|
|
@ -53,6 +54,12 @@ namespace Microsoft.AspNetCore.Razor.Language.IntegrationTests
|
||||||
_visitor.Depth--;
|
_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)
|
private void AssertNodeEquals(RazorIRNode node, string expected, string actual)
|
||||||
{
|
{
|
||||||
if (string.Equals(expected, actual))
|
if (string.Equals(expected, actual))
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue