MCPcopy Create free account
hub / github.com/php/frankenphp / TestValidCurlyBracePatterns

Function TestValidCurlyBracePatterns

internal/watcher/pattern_test.go:290–318  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

288}
289
290func TestValidCurlyBracePatterns(t *testing.T) {
291 t.Parallel()
292
293 data := []struct {
294 pattern string
295 file string
296 }{
297 {"/path/*.{php}", "/path/file.php"},
298 {"/path/*.{php,twig}", "/path/file.php"},
299 {"/path/*.{php,twig}", "/path/file.twig"},
300 {"/path/**/{file.php,file.twig}", "/path/subpath/file.twig"},
301 {"/path/{dir1,dir2}/file.php", "/path/dir1/file.php"},
302 {"/path/{dir1,dir2}/file.php", "/path/dir2/file.php"},
303 {"/app/{app,config,resources}/**/*.php", "/app/app/subpath/file.php"},
304 {"/app/{app,config,resources}/**/*.php", "/app/config/subpath/file.php"},
305 {"/path/{dir1,dir2}/{a,b}{a,b}.php", "/path/dir1/ab.php"},
306 {"/path/{dir1,dir2}/{a,b}{a,b}.php", "/path/dir2/aa.php"},
307 {"/path/{dir1,dir2}/{a,b}{a,b}.php", "/path/dir2/bb.php"},
308 {"/path/{dir1/test.php,dir2/test.php}", "/path/dir1/test.php"},
309 }
310
311 for _, d := range data {
312 t.Run(d.pattern, func(t *testing.T) {
313 t.Parallel()
314
315 assertPatternMatch(t, d.pattern, d.file)
316 })
317 }
318}
319
320func TestInvalidCurlyBracePatterns(t *testing.T) {
321 t.Parallel()

Callers

nothing calls this directly

Calls 1

assertPatternMatchFunction · 0.85

Tested by

no test coverage detected