package cascadia import ( "bytes" "strings" "testing" "golang.org/x/net/html" ) type selectorTest struct { HTML, selector string results []string } func nodeString(n *html.Node) string { buf := bytes.NewBufferString("") html.Render(buf, n) return buf.String() } var selectorTests = []selectorTest{ { `
This address...
`, "address", []string{ "
This address...
", }, }, { `text`, "*", []string{ "text", "", "text", }, }, { ``, "*", []string{ "", "", "", }, }, { `

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

`, }, }, { `