This commit is contained in:
Anton Tayanovskyy 2021-11-23 17:22:45 -05:00
parent 0ab7306d21
commit 233522a565

View file

@ -37,10 +37,14 @@ const (
go19Version = "go1.9" go19Version = "go1.9"
) )
func TestAssetSerialize(t *testing.T) { func skipWindows(t *testing.T) {
if runtime.GOOS == "windows" { if runtime.GOOS == "windows" {
t.Skip("Skipped on Windows: TODO handle Windows paths in test logic") t.Skip("Skipped on Windows: TODO handle Windows paths in test logic")
} }
}
func TestAssetSerialize(t *testing.T) {
skipWindows(t)
// Ensure that asset and archive serialization round trips. // Ensure that asset and archive serialization round trips.
{ {
@ -295,9 +299,7 @@ func TestDeserializeMissingHash(t *testing.T) {
} }
func TestAssetFile(t *testing.T) { func TestAssetFile(t *testing.T) {
if runtime.GOOS == "windows" { skipWindows(t)
t.Skip("Skipped on Windows: TODO handle Windows paths in test logic")
}
asset, err := NewPathAsset("../../../../pkg/resource/testdata/Fox.txt") asset, err := NewPathAsset("../../../../pkg/resource/testdata/Fox.txt")
assert.Nil(t, err) assert.Nil(t, err)
@ -311,9 +313,7 @@ asset jumps over the archive.
} }
func TestArchiveDir(t *testing.T) { func TestArchiveDir(t *testing.T) {
if runtime.GOOS == "windows" { skipWindows(t)
t.Skip("Skipped on Windows: TODO handle Windows paths in test logic")
}
arch, err := NewPathArchive("../../../../pkg/resource/testdata/test_dir") arch, err := NewPathArchive("../../../../pkg/resource/testdata/test_dir")
assert.Nil(t, err) assert.Nil(t, err)
@ -328,9 +328,7 @@ func TestArchiveDir(t *testing.T) {
} }
func TestArchiveTar(t *testing.T) { func TestArchiveTar(t *testing.T) {
if runtime.GOOS == "windows" { skipWindows(t)
t.Skip("Skipped on Windows: TODO handle Windows paths in test logic")
}
// Note that test data was generated using the Go 1.9 headers // Note that test data was generated using the Go 1.9 headers
arch, err := NewPathArchive("../../../../pkg/resource/testdata/test_dir.tar") arch, err := NewPathArchive("../../../../pkg/resource/testdata/test_dir.tar")
@ -340,9 +338,7 @@ func TestArchiveTar(t *testing.T) {
} }
func TestArchiveTgz(t *testing.T) { func TestArchiveTgz(t *testing.T) {
if runtime.GOOS == "windows" { skipWindows(t)
t.Skip("Skipped on Windows: TODO handle Windows paths in test logic")
}
// Note that test data was generated using the Go 1.9 headers // Note that test data was generated using the Go 1.9 headers
arch, err := NewPathArchive("../../../../pkg/resource/testdata/test_dir.tgz") arch, err := NewPathArchive("../../../../pkg/resource/testdata/test_dir.tgz")
@ -352,9 +348,7 @@ func TestArchiveTgz(t *testing.T) {
} }
func TestArchiveZip(t *testing.T) { func TestArchiveZip(t *testing.T) {
if runtime.GOOS == "windows" { skipWindows(t)
t.Skip("Skipped on Windows: TODO handle Windows paths in test logic")
}
// Note that test data was generated using the Go 1.9 headers // Note that test data was generated using the Go 1.9 headers
arch, err := NewPathArchive("../../../../pkg/resource/testdata/test_dir.zip") arch, err := NewPathArchive("../../../../pkg/resource/testdata/test_dir.zip")
@ -364,9 +358,7 @@ func TestArchiveZip(t *testing.T) {
} }
func TestArchiveJar(t *testing.T) { func TestArchiveJar(t *testing.T) {
if runtime.GOOS == "windows" { skipWindows(t)
t.Skip("Skipped on Windows: TODO handle Windows paths in test logic")
}
arch, err := NewPathArchive("../../../../pkg/resource/testdata/test_dir.jar") arch, err := NewPathArchive("../../../../pkg/resource/testdata/test_dir.jar")
assert.Nil(t, err) assert.Nil(t, err)
@ -423,9 +415,7 @@ func TestArchiveZipFiles(t *testing.T) {
//nolint: gosec //nolint: gosec
func TestNestedArchive(t *testing.T) { func TestNestedArchive(t *testing.T) {
if runtime.GOOS == "windows" { skipWindows(t)
t.Skip("Skipped on Windows: TODO handle Windows paths in test logic")
}
// Create temp dir and place some files. // Create temp dir and place some files.
dirName, err := ioutil.TempDir("", "") dirName, err := ioutil.TempDir("", "")
@ -467,9 +457,7 @@ func TestNestedArchive(t *testing.T) {
//nolint: gosec //nolint: gosec
func TestFileReferencedThroughMultiplePaths(t *testing.T) { func TestFileReferencedThroughMultiplePaths(t *testing.T) {
if runtime.GOOS == "windows" { skipWindows(t)
t.Skip("Skipped on Windows: TODO handle Windows paths in test logic")
}
// Create temp dir and place some files. // Create temp dir and place some files.
dirName, err := ioutil.TempDir("", "") dirName, err := ioutil.TempDir("", "")