File tree Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change 4
4
package limayaml
5
5
6
6
import (
7
+ "bytes"
7
8
"encoding/json"
8
9
"os"
10
+ "path/filepath"
11
+ "runtime"
9
12
"testing"
10
13
11
14
"gotest.tools/v3/assert"
@@ -30,10 +33,18 @@ func TestEmptyYAML(t *testing.T) {
30
33
const defaultYAML = "{}\n "
31
34
32
35
func TestDefaultYAML (t * testing.T ) {
33
- bytes , err := os .ReadFile ("default.yaml" )
36
+ content , err := os .ReadFile ("default.yaml" )
34
37
assert .NilError (t , err )
38
+ // if this is the unresolved symlink as a file, then make sure to resolve it
39
+ if runtime .GOOS == "windows" && bytes .HasPrefix (content , []byte {'.' , '.' }) {
40
+ f , err := filepath .Rel ("." , string (content ))
41
+ assert .NilError (t , err )
42
+ content , err = os .ReadFile (f )
43
+ assert .NilError (t , err )
44
+ }
45
+
35
46
var y LimaYAML
36
- err = Unmarshal (bytes , & y , "" )
47
+ err = Unmarshal (content , & y , "" )
37
48
assert .NilError (t , err )
38
49
y .Images = nil // remove default images
39
50
y .Mounts = nil // remove default mounts
You can’t perform that action at this time.
0 commit comments