Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(593)

Issue 51480043: testing/checkers: more informative DeepEquals

Can't Edit
Can't Publish+Mail
Start Review
Created:
11 years, 2 months ago by rog
Modified:
11 years, 2 months ago
Reviewers:
dimitern, mp+201432
Visibility:
Public.

Description

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 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+273 lines, -110 lines) Patch
A [revision details] View 1 2 1 chunk +2 lines, -0 lines 0 comments Download
M testing/checkers/bool.go View 1 chunk +4 lines, -1 line 0 comments Download
M testing/checkers/bool_test.go View 1 chunk +5 lines, -1 line 0 comments Download
M testing/checkers/deepequal.go View 1 2 4 chunks +190 lines, -52 lines 0 comments Download
M testing/checkers/deepequal_test.go View 1 2 8 chunks +72 lines, -56 lines 0 comments Download

Messages

Total messages: 4
rog
Please take a look.
11 years, 2 months ago (2014-01-13 15:13:39 UTC) #1
dimitern
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.go#newcode110 ...
11 years, 2 months ago (2014-01-13 15:28:04 UTC) #2
rog
Please take a look.
11 years, 2 months ago (2014-01-13 16:06:15 UTC) #3
rog
11 years, 2 months ago (2014-01-13 16:09:14 UTC) #4
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.
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b