Browse Source

pkg/archive: remove tests for CanonicalTarNameForPath

Now that CanonicalTarNameForPath is an alias for filepath.ToSlash, they were
mostly redundant, and only testing Go's stdlib. Coverage for filepath.ToSlash is
provided through TestCanonicalTarName, which does a superset of CanonicalTarNameForPath,

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Sebastiaan van Stijn 2 years ago
parent
commit
8b36298d7f
2 changed files with 0 additions and 28 deletions
  1. 0 13
      pkg/archive/archive_unix_test.go
  2. 0 15
      pkg/archive/archive_windows_test.go

+ 0 - 13
pkg/archive/archive_unix_test.go

@@ -23,19 +23,6 @@ import (
 	"gotest.tools/v3/skip"
 )
 
-func TestCanonicalTarNameForPath(t *testing.T) {
-	cases := []struct{ in, expected string }{
-		{"foo", "foo"},
-		{"foo/bar", "foo/bar"},
-		{"foo/dir/", "foo/dir/"},
-	}
-	for _, v := range cases {
-		if CanonicalTarNameForPath(v.in) != v.expected {
-			t.Fatalf("wrong canonical tar name. expected:%s got:%s", v.expected, CanonicalTarNameForPath(v.in))
-		}
-	}
-}
-
 func TestCanonicalTarName(t *testing.T) {
 	cases := []struct {
 		in       string

+ 0 - 15
pkg/archive/archive_windows_test.go

@@ -33,21 +33,6 @@ func TestCopyFileWithInvalidDest(t *testing.T) {
 	}
 }
 
-func TestCanonicalTarNameForPath(t *testing.T) {
-	cases := []struct {
-		in, expected string
-	}{
-		{"foo", "foo"},
-		{"foo/bar", "foo/bar"},
-		{`foo\bar`, "foo/bar"},
-	}
-	for _, v := range cases {
-		if CanonicalTarNameForPath(v.in) != v.expected {
-			t.Fatalf("wrong canonical tar name. expected:%s got:%s", v.expected, CanonicalTarNameForPath(v.in))
-		}
-	}
-}
-
 func TestCanonicalTarName(t *testing.T) {
 	cases := []struct {
 		in       string