mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-06-14 02:20:53 +00:00
Bulk move from k8s.io/kubectl
This commit is contained in:
37
vendor/github.com/modern-go/reflect2/tests/slice_array_test.go
generated
vendored
Normal file
37
vendor/github.com/modern-go/reflect2/tests/slice_array_test.go
generated
vendored
Normal file
@@ -0,0 +1,37 @@
|
||||
package tests
|
||||
|
||||
import (
|
||||
"testing"
|
||||
"github.com/modern-go/reflect2"
|
||||
)
|
||||
|
||||
func Test_slice_array(t *testing.T) {
|
||||
t.Run("SetIndex", testOp(func(api reflect2.API) interface{} {
|
||||
obj := [][1]int{{}, {}}
|
||||
valType := api.TypeOf(obj).(reflect2.SliceType)
|
||||
valType.SetIndex(obj, 0, [1]int{1})
|
||||
valType.SetIndex(obj, 1, [1]int{2})
|
||||
return obj
|
||||
}))
|
||||
t.Run("SetIndex single ptr struct", testOp(func(api reflect2.API) interface{} {
|
||||
obj := [][1]*int{{}, {}}
|
||||
valType := api.TypeOf(obj).(reflect2.SliceType)
|
||||
valType.SetIndex(obj, 0, [1]*int{})
|
||||
valType.SetIndex(obj, 1, [1]*int{})
|
||||
return obj
|
||||
}))
|
||||
t.Run("SetIndex single chan struct", testOp(func(api reflect2.API) interface{} {
|
||||
obj := [][1]chan int{{}, {}}
|
||||
valType := api.TypeOf(obj).(reflect2.SliceType)
|
||||
valType.SetIndex(obj, 0, [1]chan int{})
|
||||
valType.SetIndex(obj, 1, [1]chan int{})
|
||||
return obj
|
||||
}))
|
||||
t.Run("SetIndex single func struct", testOp(func(api reflect2.API) interface{} {
|
||||
obj := [][1]func(){{}, {}}
|
||||
valType := api.TypeOf(obj).(reflect2.SliceType)
|
||||
valType.SetIndex(obj, 0, [1]func(){})
|
||||
valType.SetIndex(obj, 1, [1]func(){})
|
||||
return obj
|
||||
}))
|
||||
}
|
||||
Reference in New Issue
Block a user