MCPcopy Create free account
hub / github.com/coregx/coregex / TestPackageLevelMatchReader

Function TestPackageLevelMatchReader

regex_stdlib_compat_test.go:300–316  ·  view source on GitHub ↗

TestPackageLevelMatchReader tests the package-level MatchReader function.

(t *testing.T)

Source from the content-addressed store, hash-verified

298
299// TestPackageLevelMatchReader tests the package-level MatchReader function.
300func TestPackageLevelMatchReader(t *testing.T) {
301 reader := strings.NewReader("hello 123")
302 matched, err := MatchReader(`\d+`, reader)
303 if err != nil {
304 t.Fatalf("MatchReader error: %v", err)
305 }
306 if !matched {
307 t.Error("MatchReader should have matched")
308 }
309
310 // Test with invalid pattern
311 reader = strings.NewReader("test")
312 _, err = MatchReader(`[invalid`, reader)
313 if err == nil {
314 t.Error("MatchReader with invalid pattern should return error")
315 }
316}
317
318// TestExpandStdlibCompat tests Expand compatibility with stdlib.
319func TestExpandStdlibCompat(t *testing.T) {

Callers

nothing calls this directly

Calls 2

MatchReaderFunction · 0.85
ErrorMethod · 0.45

Tested by

no test coverage detected