Fwd: Need team agreement on testing imports

roger peppe rogpeppe at gmail.com
Fri Jun 28 10:13:33 UTC 2013


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.



More information about the Juju-dev mailing list