MCPcopy Index your code
hub / github.com/php/frankenphp / TestValidDirectoryPatterns

Function TestValidDirectoryPatterns

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

Source from the content-addressed store, hash-verified

231}
232
233func TestValidDirectoryPatterns(t *testing.T) {
234 t.Parallel()
235
236 data := []struct {
237 pattern string
238 dir string
239 }{
240 {"/path/*/*.php", "/path/subpath/file.php"},
241 {"/path/*/*/*.php", "/path/subpath/subpath/file.php"},
242 {"/path/?/*.php", "/path/1/file.php"},
243 {"/path/**/vendor/*.php", "/path/vendor/file.php"},
244 {"/path/**/vendor/*.php", "/path/subpath/vendor/file.php"},
245 {"/path/**/vendor/**/*.php", "/path/vendor/file.php"},
246 {"/path/**/vendor/**/*.php", "/path/subpath/subpath/vendor/subpath/subpath/file.php"},
247 {"/path/**/vendor/*/*.php", "/path/subpath/subpath/vendor/subpath/file.php"},
248 {"/path*/path*/*", "/path1/path2/file.php"},
249 }
250
251 for _, d := range data {
252 t.Run(d.pattern, func(t *testing.T) {
253 t.Parallel()
254
255 assertPatternMatch(t, d.pattern, d.dir)
256 })
257 }
258}
259
260func TestInvalidDirectoryPatterns(t *testing.T) {
261 t.Parallel()

Callers

nothing calls this directly

Calls 1

assertPatternMatchFunction · 0.85

Tested by

no test coverage detected