forked from TrueCloudLab/distribution
Add more repository name validation test cases
Signed-off-by: Stephen J Day <stephen.day@docker.com>
This commit is contained in:
parent
97ca39d26d
commit
4bff4910b5
1 changed files with 36 additions and 0 deletions
|
@ -73,6 +73,42 @@ func TestRepositoryNameRegexp(t *testing.T) {
|
|||
input: strings.Repeat("a", 256),
|
||||
err: ErrRepositoryNameLong,
|
||||
},
|
||||
{
|
||||
input: "-foo/bar",
|
||||
err: ErrRepositoryNameComponentInvalid,
|
||||
},
|
||||
{
|
||||
input: "foo/bar-",
|
||||
err: ErrRepositoryNameComponentInvalid,
|
||||
},
|
||||
{
|
||||
input: "foo-/bar",
|
||||
err: ErrRepositoryNameComponentInvalid,
|
||||
},
|
||||
{
|
||||
input: "foo/-bar",
|
||||
err: ErrRepositoryNameComponentInvalid,
|
||||
},
|
||||
{
|
||||
input: "_foo/bar",
|
||||
err: ErrRepositoryNameComponentInvalid,
|
||||
},
|
||||
{
|
||||
input: "foo/bar_",
|
||||
err: ErrRepositoryNameComponentInvalid,
|
||||
},
|
||||
{
|
||||
input: "____/____",
|
||||
err: ErrRepositoryNameComponentInvalid,
|
||||
},
|
||||
{
|
||||
input: "_docker/_docker",
|
||||
err: ErrRepositoryNameComponentInvalid,
|
||||
},
|
||||
{
|
||||
input: "docker_/docker_",
|
||||
err: ErrRepositoryNameComponentInvalid,
|
||||
},
|
||||
} {
|
||||
|
||||
failf := func(format string, v ...interface{}) {
|
||||
|
|
Loading…
Reference in a new issue