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

Issue 10395044: Some useful checkers.

Can't Edit
Can't Publish+Mail
Start Review
Created:
10 years, 10 months ago by thumper
Modified:
10 years, 10 months ago
Reviewers:
mue, jameinel, mp+170227, wallyworld, rog
Visibility:
Public.

Description

Some useful checkers. Also some testing functions used later, with their own test. https://code.launchpad.net/~thumper/juju-core/moar-checkers/+merge/170227 (do not edit description out of merge proposal)

Patch Set 1 #

Patch Set 2 : Some useful checkers. #

Total comments: 2

Patch Set 3 : Some useful checkers. #

Total comments: 11
Unified diffs Side-by-side diffs Delta from patch set Stats (+229 lines, -0 lines) Patch
A [revision details] View 1 2 1 chunk +2 lines, -0 lines 0 comments Download
A testing/checkers/bool.go View 1 2 1 chunk +35 lines, -0 lines 2 comments Download
A testing/checkers/bool_test.go View 1 2 1 chunk +27 lines, -0 lines 2 comments Download
A testing/checkers/checker_test.go View 1 chunk +27 lines, -0 lines 0 comments Download
A testing/checkers/relop.go View 1 1 chunk +52 lines, -0 lines 1 comment Download
A testing/checkers/relop_test.go View 1 1 chunk +24 lines, -0 lines 4 comments Download
A testing/file.go View 1 chunk +28 lines, -0 lines 2 comments Download
A testing/file_test.go View 1 chunk +34 lines, -0 lines 0 comments Download

Messages

Total messages: 8
thumper
Please take a look.
10 years, 10 months ago (2013-06-19 00:20:53 UTC) #1
thumper
Please take a look.
10 years, 10 months ago (2013-06-19 00:33:51 UTC) #2
wallyworld
LGTM https://codereview.appspot.com/10395044/diff/3001/testing/checkers/bool.go File testing/checkers/bool.go (right): https://codereview.appspot.com/10395044/diff/3001/testing/checkers/bool.go#newcode27 testing/checkers/bool.go:27: return false, "obtained value not a bool" If ...
10 years, 10 months ago (2013-06-19 00:50:23 UTC) #3
thumper
Please take a look. https://codereview.appspot.com/10395044/diff/3001/testing/checkers/bool.go File testing/checkers/bool.go (right): https://codereview.appspot.com/10395044/diff/3001/testing/checkers/bool.go#newcode27 testing/checkers/bool.go:27: return false, "obtained value not ...
10 years, 10 months ago (2013-06-19 01:12:58 UTC) #4
jameinel
LGTM I have some comments about it, but the only one I really want to ...
10 years, 10 months ago (2013-06-19 04:32:28 UTC) #5
thumper
https://codereview.appspot.com/10395044/diff/7001/testing/checkers/bool_test.go File testing/checkers/bool_test.go (right): https://codereview.appspot.com/10395044/diff/7001/testing/checkers/bool_test.go#newcode22 testing/checkers/bool_test.go:22: } On 2013/06/19 04:32:28, jameinel wrote: > 'received' which ...
10 years, 10 months ago (2013-06-19 05:01:28 UTC) #6
mue
LGTM, thanks for moving it into an own CL. https://codereview.appspot.com/10395044/diff/7001/testing/checkers/bool.go File testing/checkers/bool.go (right): https://codereview.appspot.com/10395044/diff/7001/testing/checkers/bool.go#newcode13 testing/checkers/bool.go:13: ...
10 years, 10 months ago (2013-06-19 08:31:29 UTC) #7
rog
10 years, 10 months ago (2013-06-19 11:19:05 UTC) #8
https://codereview.appspot.com/10395044/diff/7001/testing/checkers/bool.go
File testing/checkers/bool.go (right):

https://codereview.appspot.com/10395044/diff/7001/testing/checkers/bool.go#ne...
testing/checkers/bool.go:34: return false, fmt.Sprintf("expected type bool,
recieved %s:%#v", value.Kind(), params[0])
return false, fmt.Sprintf("expected type bool, received %s", value.Type())

?
(gocheck itself will print the value for you - no need to print it again).

https://codereview.appspot.com/10395044/diff/7001/testing/checkers/relop.go
File testing/checkers/relop.go (right):

https://codereview.appspot.com/10395044/diff/7001/testing/checkers/relop.go#n...
testing/checkers/relop.go:51: return false, fmt.Sprintf("obtained value %s:%#v
not supported", p0value.Kind(), params[0])
fmt.Sprintf("expected numeric type, received %T", p0value)

?

https://codereview.appspot.com/10395044/diff/7001/testing/checkers/relop_test.go
File testing/checkers/relop_test.go (right):

https://codereview.appspot.com/10395044/diff/7001/testing/checkers/relop_test...
testing/checkers/relop_test.go:4: package checkers_test
i'm not sure we gain much by having a separate test file for each kind of
checker. i'd put them all in one file and test suite (checkers_test.go), making
it easy to scan 'em all at once.

https://codereview.appspot.com/10395044/diff/7001/testing/checkers/relop_test...
testing/checkers/relop_test.go:8: . "launchpad.net/juju-core/testing/checkers"
I object to the spreading use of import to .

gocheck itself is bad enough.

Rather than polluting the local package name space,
could we choose a suitable short package identifier
or alias please? Or just use "checkers" itself.

if we adopted the fairly standard abbreviations
that john suggests, we could have something like:

c.Assert(45, checkers.GT, 42)

which isn't too much typing, and it's obvious where
the names come from.
Sign in to reply to this message.

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