MCPcopy
hub / github.com/air-verse/air / TestIsIncludeExtWildcard

Function TestIsIncludeExtWildcard

runner/util_test.go:574–598  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

572}
573
574func TestIsIncludeExtWildcard(t *testing.T) {
575 tmpDir := t.TempDir()
576 binPath := filepath.Join(tmpDir, "tmp", "main")
577
578 e := Engine{
579 config: &Config{
580 Root: tmpDir,
581 Build: cfgBuild{
582 CfgBuildCommon: CfgBuildCommon{
583 Entrypoint: entrypoint{binPath},
584 },
585 IncludeExt: []string{"*"},
586 },
587 },
588 }
589 // Wildcard should match all file extensions
590 assert.True(t, e.isIncludeExt("main.go"))
591 assert.True(t, e.isIncludeExt("/path/to/file.html"))
592 assert.True(t, e.isIncludeExt("main.js"))
593 assert.True(t, e.isIncludeExt("file.css"))
594 assert.True(t, e.isIncludeExt("file")) // files without extension
595 assert.True(t, e.isIncludeExt("/path/noext")) // files without extension
596 assert.False(t, e.isIncludeExt(binPath)) // binary file should be excluded
597 assert.True(t, e.isIncludeExt("some/other/bin")) // other files without extension are ok
598}
599
600func TestIsIncludeExtWildcardWithSpaces(t *testing.T) {
601 e := Engine{

Callers

nothing calls this directly

Calls 1

isIncludeExtMethod · 0.95

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…