diff options
author | Miloslav Trmač <mitr@redhat.com> | 2019-01-09 21:42:37 +0100 |
---|---|---|
committer | Miloslav Trmač <mitr@redhat.com> | 2019-01-14 04:07:23 +0100 |
commit | f92c3ce35033a558a9c86c824a829368a472f873 (patch) | |
tree | df4a527285d53d505790993ea6e6db6bb23fbf9b /libpod/image/image_test.go | |
parent | b9c0f2c987688a8e7ee2c8f4e4fbf6b1a8fee024 (diff) | |
download | podman-f92c3ce35033a558a9c86c824a829368a472f873.tar.gz podman-f92c3ce35033a558a9c86c824a829368a472f873.tar.bz2 podman-f92c3ce35033a558a9c86c824a829368a472f873.zip |
Return a reference.Named from normalizedTag
Instead of returning a string, return a native value and convert it
into the string in the caller, to make it that small bit more
common to use reference types.
Should not change behavior.
Signed-off-by: Miloslav Trmač <mitr@redhat.com>
Diffstat (limited to 'libpod/image/image_test.go')
-rw-r--r-- | libpod/image/image_test.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/libpod/image/image_test.go b/libpod/image/image_test.go index 96148c2cd..077ae460e 100644 --- a/libpod/image/image_test.go +++ b/libpod/image/image_test.go @@ -257,7 +257,7 @@ func Test_stripSha256(t *testing.T) { assert.Equal(t, stripSha256("sha256:a"), "a") } -func TestNormalizeTag(t *testing.T) { +func TestNormalizedTag(t *testing.T) { const digestSuffix = "@sha256:0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef" for _, c := range []struct{ input, expected string }{ @@ -270,12 +270,12 @@ func TestNormalizeTag(t *testing.T) { {"ns/busybox:latest", "localhost/ns/busybox:latest"}, // Unqualified with a dot-less namespace {"docker.io/busybox:latest", "docker.io/library/busybox:latest"}, // docker.io without /library/ } { - res, err := normalizeTag(c.input) + res, err := normalizedTag(c.input) if c.expected == "" { assert.Error(t, err, c.input) } else { assert.NoError(t, err, c.input) - assert.Equal(t, c.expected, res) + assert.Equal(t, c.expected, res.String()) } } } |