mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
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:
parent
d59758450b
commit
8b36298d7f
2 changed files with 0 additions and 28 deletions
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue