Bumping k8s dependencies to 1.13
This commit is contained in:
48
vendor/github.com/imdario/mergo/issue66_test.go
generated
vendored
Normal file
48
vendor/github.com/imdario/mergo/issue66_test.go
generated
vendored
Normal file
@@ -0,0 +1,48 @@
|
||||
package mergo
|
||||
|
||||
import (
|
||||
"testing"
|
||||
)
|
||||
|
||||
type PrivateSliceTest66 struct {
|
||||
PublicStrings []string
|
||||
privateStrings []string
|
||||
}
|
||||
|
||||
func TestPrivateSlice(t *testing.T) {
|
||||
p1 := PrivateSliceTest66{
|
||||
PublicStrings: []string{"one", "two", "three"},
|
||||
privateStrings: []string{"four", "five"},
|
||||
}
|
||||
p2 := PrivateSliceTest66{
|
||||
PublicStrings: []string{"six", "seven"},
|
||||
}
|
||||
if err := Merge(&p1, p2); err != nil {
|
||||
t.Fatalf("Error during the merge: %v", err)
|
||||
}
|
||||
if len(p1.PublicStrings) != 3 {
|
||||
t.Error("5 elements should be in 'PublicStrings' field")
|
||||
}
|
||||
if len(p1.privateStrings) != 2 {
|
||||
t.Error("2 elements should be in 'privateStrings' field")
|
||||
}
|
||||
}
|
||||
|
||||
func TestPrivateSliceWithAppendSlice(t *testing.T) {
|
||||
p1 := PrivateSliceTest66{
|
||||
PublicStrings: []string{"one", "two", "three"},
|
||||
privateStrings: []string{"four", "five"},
|
||||
}
|
||||
p2 := PrivateSliceTest66{
|
||||
PublicStrings: []string{"six", "seven"},
|
||||
}
|
||||
if err := Merge(&p1, p2, WithAppendSlice); err != nil {
|
||||
t.Fatalf("Error during the merge: %v", err)
|
||||
}
|
||||
if len(p1.PublicStrings) != 5 {
|
||||
t.Error("5 elements should be in 'PublicStrings' field")
|
||||
}
|
||||
if len(p1.privateStrings) != 2 {
|
||||
t.Error("2 elements should be in 'privateStrings' field")
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user