Opened 3 years ago

Last modified 3 years ago

#27906 assigned Bug

assertInHTML('<a/><b/>', '<a/><b/><c/>') fails

Reported by: Michal Petrucha Owned by: Michal Petrucha
Component: Testing framework Version: master
Severity: Normal Keywords:
Cc: Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description (last modified by Michal Petrucha)

As the title indicates, HTML substring search fails to find matches in the haystack if the needle consists of multiple sibling elements that do appear in the haystack with more siblings on the same level.

This is a follow-up to #24112, which fixed the simple case when the list of children of an element matches exactly the list of children of the needle.

A simple, but somewhat sub-optimal solution could be to use two nested loops to compare the children of self with the children of the root element; an optimal, but much more complex solution would be to implement a variant of KMP on the children of self.

Change History (2)

comment:1 Changed 3 years ago by Michal Petrucha

Description: modified (diff)
Summary: assertContains('<a/><b/><c/>', '<a/><b/>', html=True) failsassertInHTML('<a/><b/>', '<a/><b/><c/>') fails

comment:2 Changed 3 years ago by Tim Graham

Triage Stage: UnreviewedAccepted
Note: See TracTickets for help on using tickets.
Back to Top