mirror of
				https://github.com/k3s-io/kubernetes.git
				synced 2025-11-04 07:49:35 +00:00 
			
		
		
		
	updating github.com/stretchr/testify to v1.3.0
This commit is contained in:
		
							
								
								
									
										35
									
								
								vendor/github.com/stretchr/testify/LICENSE
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										35
									
								
								vendor/github.com/stretchr/testify/LICENSE
									
									
									
										generated
									
									
										vendored
									
									
								
							@@ -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.
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										32
									
								
								vendor/github.com/stretchr/testify/assert/assertions.go
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										32
									
								
								vendor/github.com/stretchr/testify/assert/assertions.go
									
									
									
										generated
									
									
										vendored
									
									
								
							@@ -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 {
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										3
									
								
								vendor/github.com/stretchr/testify/mock/mock.go
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										3
									
								
								vendor/github.com/stretchr/testify/mock/mock.go
									
									
									
										generated
									
									
										vendored
									
									
								
							@@ -176,6 +176,7 @@ func (c *Call) Maybe() *Call {
 | 
			
		||||
//    Mock.
 | 
			
		||||
//       On("MyMethod", 1).Return(nil).
 | 
			
		||||
//       On("MyOtherMethod", 'a', 'b', 'c').Return(errors.New("Some Error"))
 | 
			
		||||
//go:noinline
 | 
			
		||||
func (c *Call) On(methodName string, arguments ...interface{}) *Call {
 | 
			
		||||
	return c.Parent.On(methodName, arguments...)
 | 
			
		||||
}
 | 
			
		||||
@@ -691,7 +692,7 @@ func (args Arguments) Diff(objects []interface{}) (string, int) {
 | 
			
		||||
				output = fmt.Sprintf("%s\t%d: PASS:  %s matched by %s\n", output, i, actualFmt, matcher)
 | 
			
		||||
			} else {
 | 
			
		||||
				differences++
 | 
			
		||||
				output = fmt.Sprintf("%s\t%d: PASS:  %s not matched by %s\n", output, i, actualFmt, matcher)
 | 
			
		||||
				output = fmt.Sprintf("%s\t%d: FAIL:  %s not matched by %s\n", output, i, actualFmt, matcher)
 | 
			
		||||
			}
 | 
			
		||||
		} else if reflect.TypeOf(expected) == reflect.TypeOf((*AnythingOfTypeArgument)(nil)).Elem() {
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										2
									
								
								vendor/github.com/stretchr/testify/require/requirements.go
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								vendor/github.com/stretchr/testify/require/requirements.go
									
									
									
										generated
									
									
										vendored
									
									
								
							@@ -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{})
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user