containerd/vendor/github.com/opencontainers/runc/libcontainer/utils/utils_test.go
Marcos Lilljedahl d5742209d3 Switch to new vendor directory layout
Fixes #113

Signed-off-by: Marcos Lilljedahl <marcosnils@gmail.com>
2016-03-16 01:56:22 -03:00

25 lines
514 B
Go

package utils
import "testing"
func TestGenerateName(t *testing.T) {
name, err := GenerateRandomName("veth", 5)
if err != nil {
t.Fatal(err)
}
expected := 5 + len("veth")
if len(name) != expected {
t.Fatalf("expected name to be %d chars but received %d", expected, len(name))
}
name, err = GenerateRandomName("veth", 65)
if err != nil {
t.Fatal(err)
}
expected = 64 + len("veth")
if len(name) != expected {
t.Fatalf("expected name to be %d chars but received %d", expected, len(name))
}
}