fix compiler unit tests, hook up daemon

This commit is contained in:
Brad Rydzewski
2019-10-22 23:13:40 -07:00
parent 22e660dda7
commit 09f19e5b99
28 changed files with 1694 additions and 791 deletions

View File

@@ -297,3 +297,41 @@ func Test_matchTag(t *testing.T) {
}
}
}
func Test_isLatest(t *testing.T) {
testdata := []struct {
name string
want bool
}{
{
name: "golang:1",
want: false,
},
{
name: "golang",
want: true,
},
{
name: "golang:latest",
want: true,
},
{
name: "docker.io/library/golang",
want: true,
},
{
name: "docker.io/library/golang:latest",
want: true,
},
{
name: "docker.io/library/golang:1",
want: false,
},
}
for _, test := range testdata {
got, want := IsLatest(test.name), test.want
if got != want {
t.Errorf("Want image %q isLatest %v", test.name, want)
}
}
}