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>
This commit is contained in:
Sebastiaan van Stijn 2022-08-30 10:41:53 +02:00
parent d59758450b
commit 8b36298d7f
No known key found for this signature in database
GPG Key ID: 76698F39D527CE8C
2 changed files with 0 additions and 28 deletions

View File

@ -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

View File

@ -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