package cascadia import ( "strings" "testing" "golang.org/x/net/html" ) type selectorTest struct { HTML, selector string results []string } func nodeString(n *html.Node) string { switch n.Type { case html.TextNode: return n.Data case html.ElementNode: return html.Token{ Type: html.StartTagToken, Data: n.Data, Attr: n.Attr, }.String() } return "" } var selectorTests = []selectorTest{ { `
This address...
`, "address", []string{ "
", }, }, { ``, "*", []string{ "", "", "", "", }, }, { `

`, "#foo", []string{ `

`, }, }, { `