acc: Fix singleTest option to support forward slashes (#2336)

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.
This commit is contained in:
Denis Bilenko 2025-02-11 15:26:46 +01:00 committed by GitHub
parent 878fa80322
commit 272ce61302
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 3 deletions

View File

@ -180,8 +180,7 @@ func testAccept(t *testing.T, InprocessMode bool, singleTest string) int {
} }
for _, dir := range testDirs { for _, dir := range testDirs {
testName := strings.ReplaceAll(dir, "\\", "/") t.Run(dir, func(t *testing.T) {
t.Run(testName, func(t *testing.T) {
if !InprocessMode { if !InprocessMode {
t.Parallel() t.Parallel()
} }
@ -203,7 +202,8 @@ func getTests(t *testing.T) []string {
name := filepath.Base(path) name := filepath.Base(path)
if name == EntryPointScript { if name == EntryPointScript {
// Presence of 'script' marks a test case in this directory // 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 return nil
}) })