MCPcopy Create free account
hub / github.com/PuerkitoBio/goquery / TestText_MultiSelection

Function TestText_MultiSelection

utilities_test.go:148–159  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

146}
147
148func TestText_MultiSelection(t *testing.T) {
149 doc, err := NewDocumentFromReader(strings.NewReader(textNodes))
150 if err != nil {
151 t.Fatal(err)
152 }
153
154 got := Text(doc.Find("h1, p"), &TextOptions{Separator: ",", Trim: true})
155 want := "Hello,world"
156 if got != want {
157 t.Errorf("want %q, got %q", want, got)
158 }
159}
160
161func TestText_EmptySelection(t *testing.T) {
162 doc, err := NewDocumentFromReader(strings.NewReader(textNodes))

Callers

nothing calls this directly

Calls 3

NewDocumentFromReaderFunction · 0.85
TextFunction · 0.85
FindMethod · 0.80

Tested by

no test coverage detected