package scraper import ( "strings" "testing" "golang.org/x/net/html" ) const fragment = `
` func TestMatchElemAttr(t *testing.T) { n, err := html.ParseFragment(strings.NewReader(fragment), body) if err != nil { t.Error(err) } n1 := n[0] result, err := MatchElemAttr(fragment, n1) if err != nil { t.Error(err) } if !result { t.Fail() } }