vendor: remove dep and use vndr
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
This commit is contained in:
parent
16f44674a4
commit
148e72d81e
16131 changed files with 73815 additions and 4235138 deletions
56
vendor/github.com/containers/storage/pkg/stringid/stringid_test.go
generated
vendored
56
vendor/github.com/containers/storage/pkg/stringid/stringid_test.go
generated
vendored
|
@ -1,56 +0,0 @@
|
|||
package stringid
|
||||
|
||||
import (
|
||||
"strings"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestGenerateRandomID(t *testing.T) {
|
||||
id := GenerateRandomID()
|
||||
|
||||
if len(id) != 64 {
|
||||
t.Fatalf("Id returned is incorrect: %s", id)
|
||||
}
|
||||
}
|
||||
|
||||
func TestShortenId(t *testing.T) {
|
||||
id := GenerateRandomID()
|
||||
truncID := TruncateID(id)
|
||||
if len(truncID) != 12 {
|
||||
t.Fatalf("Id returned is incorrect: truncate on %s returned %s", id, truncID)
|
||||
}
|
||||
}
|
||||
|
||||
func TestShortenIdEmpty(t *testing.T) {
|
||||
id := ""
|
||||
truncID := TruncateID(id)
|
||||
if len(truncID) > len(id) {
|
||||
t.Fatalf("Id returned is incorrect: truncate on %s returned %s", id, truncID)
|
||||
}
|
||||
}
|
||||
|
||||
func TestShortenIdInvalid(t *testing.T) {
|
||||
id := "1234"
|
||||
truncID := TruncateID(id)
|
||||
if len(truncID) != len(id) {
|
||||
t.Fatalf("Id returned is incorrect: truncate on %s returned %s", id, truncID)
|
||||
}
|
||||
}
|
||||
|
||||
func TestIsShortIDNonHex(t *testing.T) {
|
||||
id := "some non-hex value"
|
||||
if IsShortID(id) {
|
||||
t.Fatalf("%s is not a short ID", id)
|
||||
}
|
||||
}
|
||||
|
||||
func TestIsShortIDNotCorrectSize(t *testing.T) {
|
||||
id := strings.Repeat("a", shortLen+1)
|
||||
if IsShortID(id) {
|
||||
t.Fatalf("%s is not a short ID", id)
|
||||
}
|
||||
id = strings.Repeat("a", shortLen-1)
|
||||
if IsShortID(id) {
|
||||
t.Fatalf("%s is not a short ID", id)
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue