From da57b3205c8952283c6dba7c1345b513686a7611 Mon Sep 17 00:00:00 2001 From: Luke Kingland Date: Fri, 16 Feb 2024 14:16:21 +0900 Subject: [PATCH] windows-specific test --- pkg/oci/containerize_test.go | 7 +++---- pkg/oci/testdata/test-links/absoluteLinkWindows | 1 + 2 files changed, 4 insertions(+), 4 deletions(-) create mode 120000 pkg/oci/testdata/test-links/absoluteLinkWindows diff --git a/pkg/oci/containerize_test.go b/pkg/oci/containerize_test.go index cd587b06d4..6817b32749 100644 --- a/pkg/oci/containerize_test.go +++ b/pkg/oci/containerize_test.go @@ -41,11 +41,10 @@ func Test_validateLink(t *testing.T) { } }) } + // Run a windows-specific absolute path test - // Note this technically succeeds on unix systems, but wrapping in - // an runtime check seems like a good idea to make it more clear. - if runtime.GOOS != "windows" { - path := "c://some/absolute/path" + if runtime.GOOS == "windows" { + path := "testdata/test-links/absoluteLinkWindows" info, err := os.Lstat(path) if err != nil { t.Fatal(err) diff --git a/pkg/oci/testdata/test-links/absoluteLinkWindows b/pkg/oci/testdata/test-links/absoluteLinkWindows new file mode 120000 index 0000000000..c3aaf3f5c3 --- /dev/null +++ b/pkg/oci/testdata/test-links/absoluteLinkWindows @@ -0,0 +1 @@ +c://some/absolute/path \ No newline at end of file