Skip to content

bug in get xpath of node #29

@deaknaew

Description

@deaknaew

it's have bug that will navigate to wrong child when apply node filter

in Org.XmlUnit.Diff
DOMDifferenceEngine
function
UnmatchedControlNodes
and
UnmatchedTestNodes

the problem is that NavigateToChild was passed by index of List
that was filtered out
it must get correct index before pass to NavigateToChild
may be add something like
Array.IndexOf(testList[i].ParentNode.ChildNodes.Cast().ToArray(),testList[i])

bug example

var aa= DiffBuilder.Compare("<Document><Section><Binding /><Binding /><Finding /><Finding /><Finding /><Finding /><Finding /><Finding /><Finding /></Section></Document>")
.WithTest("<Document><Section><Binding /><Binding /><Finding /><Finding /><Finding /><Finding /><Finding /><Finding /></Section></Document>")
.IgnoreWhitespace()
.WithNodeFilter(node =>  "Document,Section,Finding".Split(',').Contains(node.Name))
.WithNodeMatcher(new DefaultNodeMatcher(ElementSelectors.ByNameAndText)).Build();

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions