File tree Expand file tree Collapse file tree 1 file changed +11
-5
lines changed Expand file tree Collapse file tree 1 file changed +11
-5
lines changed Original file line number Diff line number Diff line change @@ -18,12 +18,12 @@ func TestOS(t *testing.T) {
18
18
19
19
fs := osvfs .FS ()
20
20
21
- goMod := filepath .Join (repo .RootPath , "go.mod" )
22
- goModPath := tspath .NormalizePath (goMod )
23
-
24
21
t .Run ("ReadFile" , func (t * testing.T ) {
25
22
t .Parallel ()
26
23
24
+ goMod := filepath .Join (repo .RootPath , "go.mod" )
25
+ goModPath := tspath .NormalizePath (goMod )
26
+
27
27
expectedRaw , err := os .ReadFile (goMod )
28
28
assert .NilError (t , err )
29
29
expected := string (expectedRaw )
@@ -36,12 +36,18 @@ func TestOS(t *testing.T) {
36
36
t .Run ("Realpath" , func (t * testing.T ) {
37
37
t .Parallel ()
38
38
39
- expected := goModPath
39
+ home , err := os .UserHomeDir ()
40
+ if err != nil {
41
+ t .Skip (err )
42
+ }
43
+ home = tspath .NormalizePath (home )
44
+
45
+ expected := home
40
46
if runtime .GOOS == "windows" {
41
47
// Windows drive letters can be lowercase, but realpath will always return uppercase.
42
48
expected = strings .ToUpper (expected [:1 ]) + expected [1 :]
43
49
}
44
- realpath := fs .Realpath (goModPath )
50
+ realpath := fs .Realpath (home )
45
51
assert .Equal (t , realpath , expected )
46
52
})
47
53
You can’t perform that action at this time.
0 commit comments