Skip to content

Commit

Permalink
acc: Fix singleTest option to support forward slashes (#2336)
Browse files Browse the repository at this point in the history
The filtering of tests needs to see forward slashes otherwise it is
OS-dependent.

I've also switched to filepath.ToSlash but it should be a no-op.
  • Loading branch information
denik authored Feb 11, 2025
1 parent 878fa80 commit 0dc332d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions acceptance/acceptance_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -180,8 +180,7 @@ func testAccept(t *testing.T, InprocessMode bool, singleTest string) int {
}

for _, dir := range testDirs {
testName := strings.ReplaceAll(dir, "\\", "/")
t.Run(testName, func(t *testing.T) {
t.Run(dir, func(t *testing.T) {
if !InprocessMode {
t.Parallel()
}
Expand All @@ -203,7 +202,8 @@ func getTests(t *testing.T) []string {
name := filepath.Base(path)
if name == EntryPointScript {
// Presence of 'script' marks a test case in this directory
testDirs = append(testDirs, filepath.Dir(path))
testName := filepath.ToSlash(filepath.Dir(path))
testDirs = append(testDirs, testName)
}
return nil
})
Expand Down

0 comments on commit 0dc332d

Please sign in to comment.