Bumps [github.com/stretchr/testify](https://github.com/stretchr/testify) from 1.2.2 to 1.3.0. - [Release notes](https://github.com/stretchr/testify/releases) - [Commits](https://github.com/stretchr/testify/compare/v1.2.2...v1.3.0)tags/v1.21.12.1
@@ -105,7 +105,7 @@ require ( | |||
github.com/siddontang/go-snappy v0.0.0-20140704025258-d8f7bb82a96d // indirect | |||
github.com/smartystreets/goconvey v0.0.0-20190306220146-200a235640ff // indirect | |||
github.com/steveyen/gtreap v0.0.0-20150807155958-0abe01ef9be2 // indirect | |||
github.com/stretchr/testify v1.2.2 | |||
github.com/stretchr/testify v1.3.0 | |||
github.com/tecbot/gorocksdb v0.0.0-20181010114359-8752a9433481 // indirect | |||
github.com/tinylib/msgp v0.0.0-20180516164116-c8cf64dff200 // indirect | |||
github.com/tstranex/u2f v1.0.0 | |||
@@ -55,6 +55,7 @@ github.com/cznic/mathutil v0.0.0-20181122101859-297441e03548 h1:iwZdTE0PVqJCos1v | |||
github.com/cznic/mathutil v0.0.0-20181122101859-297441e03548/go.mod h1:e6NPNENfs9mPDVNRekM7lKScauxd5kXTr1Mfyig6TDM= | |||
github.com/cznic/strutil v0.0.0-20181122101858-275e90344537 h1:MZRmHqDBd0vxNwenEbKSQqRVT24d3C05ft8kduSwlqM= | |||
github.com/cznic/strutil v0.0.0-20181122101858-275e90344537/go.mod h1:AHHPPPXTw0h6pVabbcbyGRK1DckRn7r/STdZEeIDzZc= | |||
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= | |||
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= | |||
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= | |||
github.com/denisenkom/go-mssqldb v0.0.0-20161128230840-e32ca5036449 h1:JpA+YMG4JLW8nzLmU05mTiuB0O17xHGxpWolEZ0zDuA= | |||
@@ -282,8 +283,12 @@ github.com/src-d/gcfg v1.4.0 h1:xXbNR5AlLSA315x2UO+fTSSAXCDf+Ar38/6oyGbDKQ4= | |||
github.com/src-d/gcfg v1.4.0/go.mod h1:p/UMsR43ujA89BJY9duynAwIpvqEujIH/jFlfL7jWoI= | |||
github.com/steveyen/gtreap v0.0.0-20150807155958-0abe01ef9be2 h1:JNEGSiWg6D3lcBCMCBqN3ELniXujt+0QNHLhNnO0w3s= | |||
github.com/steveyen/gtreap v0.0.0-20150807155958-0abe01ef9be2/go.mod h1:mjqs7N0Q6m5HpR7QfXVBZXZWSqTjQLeTujjA/xUp2uw= | |||
github.com/stretchr/objx v0.1.0 h1:4G4v2dO3VZwixGIRoQ5Lfboy6nUhCyYzaqnIAPPhYs4= | |||
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= | |||
github.com/stretchr/testify v1.2.2 h1:bSDNvY7ZPG5RlJ8otE/7V6gMiyenm9RtJ7IUVIAoJ1w= | |||
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= | |||
github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q= | |||
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= | |||
github.com/syndtr/goleveldb v0.0.0-20190203031304-2f17a3356c66 h1:AwmkkZT+TucFotNCL+aNJ/0KCMsRtlXN9fs8uoOMSRk= | |||
github.com/syndtr/goleveldb v0.0.0-20190203031304-2f17a3356c66/go.mod h1:ZVVdQEZoIme9iO1Ch2Jdy24qqXrMMOU6lpPAyBWyWuQ= | |||
github.com/tecbot/gorocksdb v0.0.0-20181010114359-8752a9433481 h1:HOxvxvnntLiPn123Fk+twfUhCQdMDaqmb0cclArW0T0= | |||
@@ -1,22 +1,21 @@ | |||
Copyright (c) 2012 - 2013 Mat Ryer and Tyler Bunnell | |||
MIT License | |||
Please consider promoting this project if you find it useful. | |||
Copyright (c) 2012-2018 Mat Ryer and Tyler Bunnell | |||
Permission is hereby granted, free of charge, to any person | |||
obtaining a copy of this software and associated documentation | |||
files (the "Software"), to deal in the Software without restriction, | |||
including without limitation the rights to use, copy, modify, merge, | |||
publish, distribute, sublicense, and/or sell copies of the Software, | |||
and to permit persons to whom the Software is furnished to do so, | |||
subject to the following conditions: | |||
Permission is hereby granted, free of charge, to any person obtaining a copy | |||
of this software and associated documentation files (the "Software"), to deal | |||
in the Software without restriction, including without limitation the rights | |||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |||
copies of the Software, and to permit persons to whom the Software is | |||
furnished to do so, subject to the following conditions: | |||
The above copyright notice and this permission notice shall be included | |||
in all copies or substantial portions of the Software. | |||
The above copyright notice and this permission notice shall be included in all | |||
copies or substantial portions of the Software. | |||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, | |||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES | |||
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | |||
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, | |||
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT | |||
OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE | |||
OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | |||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | |||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | |||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | |||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | |||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | |||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | |||
SOFTWARE. |
@@ -39,7 +39,7 @@ type ValueAssertionFunc func(TestingT, interface{}, ...interface{}) bool | |||
// for table driven tests. | |||
type BoolAssertionFunc func(TestingT, bool, ...interface{}) bool | |||
// ValuesAssertionFunc is a common function prototype when validating an error value. Can be useful | |||
// ErrorAssertionFunc is a common function prototype when validating an error value. Can be useful | |||
// for table driven tests. | |||
type ErrorAssertionFunc func(TestingT, error, ...interface{}) bool | |||
@@ -179,7 +179,11 @@ func messageFromMsgAndArgs(msgAndArgs ...interface{}) string { | |||
return "" | |||
} | |||
if len(msgAndArgs) == 1 { | |||
return msgAndArgs[0].(string) | |||
msg := msgAndArgs[0] | |||
if msgAsStr, ok := msg.(string); ok { | |||
return msgAsStr | |||
} | |||
return fmt.Sprintf("%+v", msg) | |||
} | |||
if len(msgAndArgs) > 1 { | |||
return fmt.Sprintf(msgAndArgs[0].(string), msgAndArgs[1:]...) | |||
@@ -415,6 +419,17 @@ func NotNil(t TestingT, object interface{}, msgAndArgs ...interface{}) bool { | |||
return Fail(t, "Expected value not to be nil.", msgAndArgs...) | |||
} | |||
// containsKind checks if a specified kind in the slice of kinds. | |||
func containsKind(kinds []reflect.Kind, kind reflect.Kind) bool { | |||
for i := 0; i < len(kinds); i++ { | |||
if kind == kinds[i] { | |||
return true | |||
} | |||
} | |||
return false | |||
} | |||
// isNil checks if a specified object is nil or not, without Failing. | |||
func isNil(object interface{}) bool { | |||
if object == nil { | |||
@@ -423,7 +438,14 @@ func isNil(object interface{}) bool { | |||
value := reflect.ValueOf(object) | |||
kind := value.Kind() | |||
if kind >= reflect.Chan && kind <= reflect.Slice && value.IsNil() { | |||
isNilableKind := containsKind( | |||
[]reflect.Kind{ | |||
reflect.Chan, reflect.Func, | |||
reflect.Interface, reflect.Map, | |||
reflect.Ptr, reflect.Slice}, | |||
kind) | |||
if isNilableKind && value.IsNil() { | |||
return true | |||
} | |||
@@ -1327,7 +1349,7 @@ func typeAndKind(v interface{}) (reflect.Type, reflect.Kind) { | |||
} | |||
// diff returns a diff of both values as long as both are of the same type and | |||
// are a struct, map, slice or array. Otherwise it returns an empty string. | |||
// are a struct, map, slice, array or string. Otherwise it returns an empty string. | |||
func diff(expected interface{}, actual interface{}) string { | |||
if expected == nil || actual == nil { | |||
return "" | |||
@@ -1345,7 +1367,7 @@ func diff(expected interface{}, actual interface{}) string { | |||
} | |||
var e, a string | |||
if ek != reflect.String { | |||
if et != reflect.TypeOf("") { | |||
e = spewConfig.Sdump(expected) | |||
a = spewConfig.Sdump(actual) | |||
} else { | |||
@@ -22,7 +22,7 @@ type ValueAssertionFunc func(TestingT, interface{}, ...interface{}) | |||
// for table driven tests. | |||
type BoolAssertionFunc func(TestingT, bool, ...interface{}) | |||
// ValuesAssertionFunc is a common function prototype when validating an error value. Can be useful | |||
// ErrorAssertionFunc is a common function prototype when validating an error value. Can be useful | |||
// for table driven tests. | |||
type ErrorAssertionFunc func(TestingT, error, ...interface{}) | |||
@@ -301,7 +301,7 @@ github.com/src-d/gcfg/token | |||
github.com/src-d/gcfg/types | |||
# github.com/steveyen/gtreap v0.0.0-20150807155958-0abe01ef9be2 | |||
github.com/steveyen/gtreap | |||
# github.com/stretchr/testify v1.2.2 | |||
# github.com/stretchr/testify v1.3.0 | |||
github.com/stretchr/testify/assert | |||
github.com/stretchr/testify/require | |||
# github.com/syndtr/goleveldb v0.0.0-20190203031304-2f17a3356c66 | |||