Code review comment for lp:~rvb/gwacl/exclude-daily

Revision history for this message
Raphaël Badin (rvb) wrote :

> Looks good.
>
>
> [1]
>
> +func (suite *xmlSuite) TestIsDailyBuild(c *C) {
> +    var testValues = []struct {
> +        image          *OSImage
> +        expectedResult bool
> +    }{
> +        {&OSImage{Label: "Ubuntu Server 12.04.2 LTS DAILY"}, true},
> +        {&OSImage{Label: "Ubuntu Server 12.04.2 LTS"}, false},
> +        {&OSImage{Label: "Ubuntu Server 13.04"}, false},
> +    }
> +    for _, test := range testValues {
> +        c.Check(test.image.isDailyBuild(), Equals, test.expectedResult)
> +    }
> +}
>
> Go's typing boilerplate makes this much longer and less readable than
> doing it the stupid way:
>
> func (suite *xmlSuite) TestIsDailyBuild(c *C) {
>    c.Check(OSImage{Label: "Ubuntu Server 12.04.2 LTS DAILY"}.isDailyBuild(),
> Equals, true)
>    c.Check(OSImage{Label: "Ubuntu Server 12.04.2 LTS"}.isDailyBuild(),
> Equals, false),
>    c.Check(OSImage{Label: "Ubuntu Server 13.04"}.isDailyBuild(), Equals,
> false),
> }

Okay, thanks for the review.

« Back to merge proposal