diff --git a/query_test.go b/query_test.go index 776cbc5..12ba148 100644 --- a/query_test.go +++ b/query_test.go @@ -7,6 +7,7 @@ import ( "net/http/httptest" "os" "strings" + "sync" "testing" "github.com/antchfx/xpath" @@ -158,6 +159,22 @@ func TestXPathCdUp(t *testing.T) { } } +func TestConcurrentQuery(t *testing.T) { + var wg sync.WaitGroup + for i := 0; i < 10; i++ { + wg.Add(1) + go func(i int) { + defer wg.Done() + s := `