(t *testing.T)
| 572 | } |
| 573 | |
| 574 | func 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 | |
| 600 | func TestIsIncludeExtWildcardWithSpaces(t *testing.T) { |
| 601 | e := Engine{ |
nothing calls this directly
no test coverage detected
searching dependent graphs…