[Theory]
[InlineData("<X><a><</X>")]
[InlineData("<X><a></</X>")]
public void IncompleteEndTag(string xml)
{
var document = T(xml);
var element = Assert.IsType<XmlElementSyntax>(document.Root.Elements.Single());
Assert.Equal("a", element.StartTag.Name);
Assert.Equal("", element.EndTag.Name);
}
In the first case ("<X><a><</X>") the test passes and element.EndTag.Name == "" however in the second case ("<X><a></</X>") the test fails because element.EndTag.Name == null.
It feels like this inconsistency is accidental, should it be normalized?
Consider the following test:
In the first case (
"<X><a><</X>"
) the test passes andelement.EndTag.Name == ""
however in the second case ("<X><a></</X>"
) the test fails becauseelement.EndTag.Name == null
.It feels like this inconsistency is accidental, should it be normalized?