|
|
|
testing/checkers: more informative DeepEquals
I have spent too long delving into the output of gc.DeepEquals
results looking for differences. This changes jc.DeepEquals
to say what you want to know.
Trivial example:
c.Assert([]int{1,3,5}, jc.DeepEquals, []int{1,3,7})
produces:
tst_test.go:17:
c.Assert([]int{1, 3, 5}, jc.DeepEquals, []int{1, 3, 7})
... obtained []int = []int{1, 3, 5}
... expected []int = []int{1, 3, 7}
... mismatch at [2]: unequal; obtained 5; expected 7
https://code.launchpad.net/~rogpeppe/juju-core/481-testing-deepequals/+merge/201432
(do not edit description out of merge proposal)
Patch Set 1 #Patch Set 2 : testing/checkers: more informative DeepEquals #
Total comments: 2
Patch Set 3 : testing/checkers: more informative DeepEquals #
Total messages: 4
|
rog
Please take a look.
|
11 years, 12 months ago (2014年01月13日 15:13:39 UTC) #1 | ||||||||||||||||||||||||||||||||||||||||||||||
Please take a look.
Excellent! LGTM with a minor grumble about more expressive tests. https://codereview.appspot.com/51480043/diff/20001/testing/checkers/bool_test.go File testing/checkers/bool_test.go (right): https://codereview.appspot.com/51480043/diff/20001/testing/checkers/bool_test... testing/checkers/bool_test.go:110: func (s *BoolSuite) TestDeepEquals(c *gc.C) { I'd like to see a couple of tests that illustrate the differences between jc.DeepEquals and gc.DeepEquals (like in the description).
Please take a look.
https://codereview.appspot.com/51480043/diff/20001/testing/checkers/bool_test.go File testing/checkers/bool_test.go (right): https://codereview.appspot.com/51480043/diff/20001/testing/checkers/bool_test... testing/checkers/bool_test.go:110: func (s *BoolSuite) TestDeepEquals(c *gc.C) { On 2014年01月13日 15:28:04, dimitern wrote: > I'd like to see a couple of tests that illustrate the differences between > jc.DeepEquals and gc.DeepEquals (like in the description). Done.