Skip to content

Commit

Permalink
internal/testing/htmlcheck: delete InAll
Browse files Browse the repository at this point in the history
It doesn't seem to be used anywhere.

For #61399

Change-Id: I068ed8638ec24702a210b269097bec735ce0368b
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/539483
LUCI-TryBot-Result: Go LUCI <[email protected]>
kokoro-CI: kokoro <[email protected]>
TryBot-Result: Gopher Robot <[email protected]>
Run-TryBot: Michael Matloob <[email protected]>
Reviewed-by: Robert Findley <[email protected]>
  • Loading branch information
matloob committed Nov 10, 2023
1 parent 8d85107 commit 545ce2a
Showing 1 changed file with 0 additions and 22 deletions.
22 changes: 0 additions & 22 deletions internal/testing/htmlcheck/htmlcheck.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,28 +60,6 @@ func In(selector string, checkers ...Checker) Checker {
}
}

// InAll runs the checkers against all nodes matching selector.
func InAll(selector string, checkers ...Checker) Checker {
sel := mustParseSelector(selector)
return func(n *html.Node) error {
els := allMatching(n, sel)
for i, el := range els {
if err := check(el, checkers); err != nil {
return fmt.Errorf("%s, #%d: %v", selector, i, err)
}
}
return nil
}
}

func allMatching(n *html.Node, sel cascadia.Sel) []*html.Node {
var els []*html.Node
if sel.Match(n) {
els = append(els, n)
}
return append(els, cascadia.QueryAll(n, sel)...)
}

// NotIn returns a checker that succeeds only if no nodes match selector.
func NotIn(selector string) Checker {
sel := mustParseSelector(selector)
Expand Down

0 comments on commit 545ce2a

Please sign in to comment.