~rogpeppe/juju-core/themue-058-debug-log-api

« back to all changes in this revision

Viewing changes to instance/instance_test.go

  • Committer: Frank Mueller
  • Date: 2014-01-23 14:14:49 UTC
  • mfrom: (2152.1.95 juju-core)
  • Revision ID: frank.mueller@canonical.com-20140123141449-b30l57y7gs3wjkpw
debugger: merged trunk and fixed permission and interface problems

Show diffs side-by-side

added added

removed removed

Lines of Context:
242
242
                c.Assert(cons1, gc.DeepEquals, hwc)
243
243
        }
244
244
}
 
245
 
 
246
type PortsSuite struct{}
 
247
 
 
248
var _ = gc.Suite(&PortsSuite{})
 
249
 
 
250
var sortPortsTests = []struct {
 
251
        have, want []instance.Port
 
252
}{
 
253
        {nil, []instance.Port{}},
 
254
        {[]instance.Port{{"b", 1}, {"a", 99}, {"a", 1}}, []instance.Port{{"a", 1}, {"a", 99}, {"b", 1}}},
 
255
}
 
256
 
 
257
func (*PortsSuite) TestSortPorts(c *gc.C) {
 
258
        for _, t := range sortPortsTests {
 
259
                p := make([]instance.Port, len(t.have))
 
260
                copy(p, t.have)
 
261
                instance.SortPorts(p)
 
262
                c.Check(p, gc.DeepEquals, t.want)
 
263
                instance.SortPorts(p)
 
264
                c.Check(p, gc.DeepEquals, t.want)
 
265
        }
 
266
}