Need team agreement on testing imports

William Reade william.reade at canonical.com
Fri Jun 28 11:15:40 UTC 2013


OK, looks like we have general agreement that we can drop the . imports
across the board. Would someone volunteer to fix it, using the short names
of their choice, and we can bikeshed them in the CL if it really seems
necessary?


On Fri, Jun 28, 2013 at 12:13 PM, roger peppe <rogpeppe at gmail.com> wrote:

> On 28 Jun 2013 08:14, "John Meinel" <john at arbash-meinel.com> wrote:
> >
> > If you troll through code reviews where this was brought up, William
> proposed possibly using a common short name. So
> >
> > import (
> >     gc "launchpad.net/gocheck"
> >     jc "launchpad.net/juju-core/testing/checkers"
> > )
>
> I originally thought that a single capital C might work well for the
> gocheck import identifier, as it won't alias any local variables or
> any types that I know of, and it's reasonably distinctive and
> suggestive. We could use JC for the juju checkers.
>
> func (suite) TestSomething(c *C.C) {
>    c.Assert(x, C.Equals, 0)
> }
>
> isn't too bad. I sympathise with ian's points about readability but I
> think consistency and accessibility are also important, and I don't
> think this will have a strong impact on readability.
>
> I suggest we try something like this (it shouldn't be too hard to do
> the change automatically) and see if the result seems ok.
>
> --
> Juju-dev mailing list
> Juju-dev at lists.ubuntu.com
> Modify settings or unsubscribe at:
> https://lists.ubuntu.com/mailman/listinfo/juju-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/juju-dev/attachments/20130628/95037452/attachment.html>


More information about the Juju-dev mailing list