MCPcopy Create free account
hub / github.com/antchfx/htmlquery / TestConcurrentQuery

Function TestConcurrentQuery

query_test.go:178–192  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

176}
177
178func TestConcurrentQuery(t *testing.T) {
179 var wg sync.WaitGroup
180 for i := 0; i < 10; i++ {
181 wg.Add(1)
182 go func(i int) {
183 defer wg.Done()
184 s := `<html><head></head><body><div>a</div></body>`
185 doc := loadHTML(s)
186 if n := FindOne(doc, `//div`); n == nil {
187 t.Fatalf("should find one but got nil [%d]", i)
188 }
189 }(i)
190 }
191 wg.Wait()
192}
193
194func TestLoadURL_ErrorCases(t *testing.T) {
195 tests := []struct {

Callers

nothing calls this directly

Calls 2

loadHTMLFunction · 0.85
FindOneFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…