-
Notifications
You must be signed in to change notification settings - Fork 209
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add diffing abilities to reporting #9
Conversation
cmp/example_test.go
Outdated
@@ -147,6 +147,7 @@ func ExampleOption_equalEmpty() { | |||
// false | |||
} | |||
|
|||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this change intentional?
It looks like it makes the file no longer gofmt
ed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch. Fixed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would you like a PR that adds a gofmt
check to Travis CI, so this type of issue can be caught automatically by CI in all future contributions?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That would be great, thank you.
The default test script is `go test -v ./...` according to Travis docs at https://docs.travis-ci.com/user/languages/go/#Default-Test-Script. Add an additional gofmt check to help catch formatting issues in PRs. This is motivated by a previous occurrence at #9 (comment). Also swap the order of Go versions 1.x and 1.6. 1.x is higher priority, so it makes more sense to run it first and report issues right away. 1.6 is lower priority, so it's better to prioritize it lower. Use 2 space indent in the .yml file, which is consistent with the formatting in Travis documentation and examples.
96e2544
to
be2c714
Compare
This adds an internal package with the following API: func Difference(nx, ny int, f EqualFunc) (eq bool, es EditScript) type EditScript []EditType type EditType int8 const Identity EditType = iota ... type EqualFunc func(ix int, iy int) Result type Result struct{ ... } The cmp.SliceIndex type has a new method SplitKeys to indicate that elements are being compared in x and y are in different indexes. The debug visualizer can be run: go test -tags=debug -v github.com/google/go-cmp/cmp/internal/diff Reviewed-By: kevlar@google.com
This adds an internal package with the following API:
func Difference(nx, ny int, f EqualFunc) (eq bool, es EditScript)
type EditScript []EditType
type EditType int8
const Identity EditType = iota ...
type EqualFunc func(ix int, iy int) Result
type Result struct{ ... }
The cmp.SliceIndex type has a new method SplitKeys to indicate that
elements are being compared in x and y are in different indexes.
The debug visualizer can be run:
go test -tags=debug -v github.com/google/go-cmp/cmp/internal/diff
Reviewed-By: dneil@google.com