MCPcopy Create free account
hub / github.com/dlclark/regexp2 / TestSplitConcurrentPoolUse

Function TestSplitConcurrentPoolUse

string_processing_test.go:249–264  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

247}
248
249func TestSplitConcurrentPoolUse(t *testing.T) {
250 re := MustCompile(`(needle)`)
251 input := "éneedle界needle😀"
252 want := []string{"é", "needle", "界", "needle", "😀"}
253 for i := 0; i < 8; i++ {
254 t.Run(fmt.Sprint(i), func(t *testing.T) {
255 t.Parallel()
256 for j := 0; j < 50; j++ {
257 got, err := re.Split(input, -1)
258 if err != nil || !slices.Equal(got, want) {
259 t.Fatal(got, err)
260 }
261 }
262 })
263 }
264}

Callers

nothing calls this directly

Calls 2

SplitMethod · 0.80
MustCompileFunction · 0.70

Tested by

no test coverage detected