aboutsummaryrefslogtreecommitdiff
path: root/cmp/cmpopts/util_test.go
AgeCommit message (Collapse)Author
2020-09-23Fix license headers (#236)Joe Tsai
There is no LICENSE.md file, but there is a LICENSE file.
2020-07-14Adjust panic for IgnoreUnexported and IgnoreFields (#228)k.nakada
Adjust the panic message to be more specific about what the user should do, and reduces the need for the user to look at the source code.
2020-05-20Permit use of IgnoreFields with unexported fields (#203)Joe Tsai
Modify IgnoreFields to permit the specification of unexported fields. To avoid a bug with reflect.Type.FieldByName, we disallow forwarding on unexported fields. See https://golang.org/issue/4876 for details. Fixes #196
2019-12-16Add EquateErrors helper (#178)Joe Tsai
The EquateErrors helper equates errors according to errors.Is. We also declare a sentinel AnyError value that matches any non-nil error value. This adds a dependency on golang.org/x/xerrors so that we can continue to suppport go1.8, which is our current minimally supported version of Go. Fixes #89
2019-12-16Adjust style of EquateApproxTime (#177)Joe Tsai
Adjust coding style of EquateApproxTime to match EquateApprox.
2019-08-29cmpopts: add EquateApproxTime (#158)Roger Peppe
2019-08-01Simplify code (#149)Christian Muehlhaeuser
- No need to wrap ToUpper & Fields - Simpler concatenation - Easier pointer access
2019-03-11Add IgnoreSliceElements and IgnoreMapEntries helpers (#126)Joe Tsai
These helper options ignore slice elements or map entries based on a user-provided predicate function. These are especially useful for ignoring missing elements or entries.
2018-11-01Bump minimum version to Go1.8 (#50)Joe Tsai
Go1.8 went GA on AppEngine. The lack of Go1.8 support was the primary reason for much of these backwards compatibility hacks. Bumping to Go1.8 still ensures that we're supporting at least the latest 2 versions of Go, which are Go1.8 and Go1.9.
2018-03-26Add AcyclicTransformer helper (#82)Joe Tsai
Add AcyclicTransformer helper, which wraps Transformer with a FilterPath that ensures that the transformer cannot be recursively applied upon the output of itself. Adjust documentation of Transformer to suggest usage of AcyclicTransformer if necessary. Fixes #77
2018-03-26Enforce tests to provide a reason (#83)Joe Tsai
To prevent future developers from getting lazy, check that a reason is given as part of each test case. Checks are only given for cmpopts. The cmp tests lack reasons, which is future work.
2017-07-17Travis: Run go vet; use race detector during tests (#16)Dmitri Shuralyov
This change augments the Travis CI build to: * Include -s (simplify) flag when checking that all files follow gofmt style. * Check that go vet does not report any problems. * Use race detector when running tests, to help catch data races. * Include a fast-finish allowed failure build on master (tip). Due to a chance of false positives, failures on tip are not critical, but manually looking over them can help spot issues either in this project, or in the tip version of Go. * Use the explicit include job feature of Travis CI to make the Go 1.6 build only run tests, and not perform go vet, etc., checks, since they are already done on new versions and can cause unnecessary failures. Reference: https://docs.travis-ci.com/user/customizing-the-build#Explicitly-Including-Jobs
2017-07-14Add cmpopts helper package (#8)Joe Tsai
This adds the following API surface: func EquateApprox(fraction, margin float64) cmp.Option func EquateEmpty() cmp.Option func EquateNaNs() cmp.Option func IgnoreFields(typ interface{}, names ...string) cmp.Option func IgnoreInterfaces(ifaces interface{}) cmp.Option func IgnoreTypes(typs ...interface{}) cmp.Option func IgnoreUnexported(typs ...interface{}) cmp.Option func SortMaps(less interface{}) cmp.Option func SortSlices(less interface{}) cmp.Option Reviewed-By: bcmills@google.com