Skip to content

Commit e94eb47

Browse files
committed
test: fix windows pathmeta test
1 parent cc5d055 commit e94eb47

2 files changed

Lines changed: 7 additions & 5 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,4 @@ coverage.out
1010
**/.available.cache
1111

1212
.vfox
13+
.gocache

internal/pathmeta/path_meta_test.go

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
package pathmeta
2020

2121
import (
22+
"path/filepath"
2223
"runtime"
2324
"testing"
2425
)
@@ -159,15 +160,15 @@ func TestContainsPathSegment(t *testing.T) {
159160
func TestApplyStoragePath(t *testing.T) {
160161
// Create a temporary directory for testing
161162
tmpDir := t.TempDir()
162-
163+
163164
// Create a PathMeta instance with default paths
164165
meta := &PathMeta{
165166
Shared: SharedPaths{
166167
Root: tmpDir,
167-
Installs: tmpDir + "/default/cache",
168+
Installs: filepath.Join(tmpDir, "default", "cache"),
168169
},
169170
}
170-
171+
171172
t.Run("Empty storage path does not change Installs", func(t *testing.T) {
172173
originalInstalls := meta.Shared.Installs
173174
err := meta.ApplyStoragePath("")
@@ -178,9 +179,9 @@ func TestApplyStoragePath(t *testing.T) {
178179
t.Errorf("Installs path changed when it shouldn't: got %q, want %q", meta.Shared.Installs, originalInstalls)
179180
}
180181
})
181-
182+
182183
t.Run("Valid storage path updates Installs", func(t *testing.T) {
183-
customPath := tmpDir + "/custom"
184+
customPath := filepath.Join(tmpDir, "custom")
184185

185186
// Now test ApplyStoragePath
186187
err := meta.ApplyStoragePath(customPath)

0 commit comments

Comments
 (0)