Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 7 of 7 for TestStruct (0.14 sec)

  1. pkg/typemap/map_test.go

    	typemap.Set[TestInterface[string]](tm, TestStruct{Field: "interface"})
    
    	assert.Equal(t, typemap.Get[int](tm), ptr.Of(1))
    	assert.Equal(t, typemap.Get[int32](tm), ptr.Of(int32(2)))
    	assert.Equal(t, typemap.Get[string](tm), ptr.Of("string"))
    	assert.Equal(t, typemap.Get[*TestStruct](tm), ptr.Of(&TestStruct{Field: "pointer"}))
    	assert.Equal(t, typemap.Get[TestInterface[string]](tm), ptr.Of(TestInterface[string](TestStruct{Field: "interface"})))
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Wed Apr 17 16:38:40 UTC 2024
    - 1.5K bytes
    - Viewed (0)
  2. staging/src/k8s.io/cli-runtime/pkg/printers/json_test.go

    	"k8s.io/apimachinery/pkg/util/json"
    	"k8s.io/client-go/kubernetes/scheme"
    )
    
    var testData = TestStruct{
    	TypeMeta:   metav1.TypeMeta{APIVersion: "foo/bar", Kind: "TestStruct"},
    	Key:        "testValue",
    	Map:        map[string]int{"TestSubkey": 1},
    	StringList: []string{"a", "b", "c"},
    	IntList:    []int{1, 2, 3},
    }
    
    type TestStruct struct {
    	metav1.TypeMeta   `json:",inline"`
    	metav1.ObjectMeta `json:"metadata,omitempty"`
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed Apr 12 15:46:12 UTC 2023
    - 4K bytes
    - Viewed (0)
  3. pkg/config/model_test.go

    				return c
    			},
    			protocmp.Transform(),
    		},
    		// Random struct pointer
    		{
    			&TestStruct{Name: "foobar"},
    			func(c Spec) Spec {
    				c.(*TestStruct).Name = "bar"
    				return c
    			},
    			nil,
    		},
    		// Random struct
    		{
    			TestStruct{Name: "foobar"},
    			func(c Spec) Spec {
    				x := c.(TestStruct)
    				x.Name = "bar"
    				return x
    			},
    			nil,
    		},
    		// Slice
    		{
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Fri Apr 12 17:37:32 UTC 2024
    - 7.9K bytes
    - Viewed (0)
  4. src/cmd/compile/internal/noder/lex_test.go

    		if !eq(got, tt.want) {
    			t.Errorf("pragmaFields(%q) = %v; want %v", tt.in, got, tt.want)
    			continue
    		}
    	}
    }
    
    func TestPragcgo(t *testing.T) {
    	type testStruct struct {
    		in   string
    		want []string
    	}
    
    	var tests = []testStruct{
    		{`go:cgo_export_dynamic local`, []string{`cgo_export_dynamic`, `local`}},
    		{`go:cgo_export_dynamic local remote`, []string{`cgo_export_dynamic`, `local`, `remote`}},
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Dec 23 06:39:06 UTC 2020
    - 3.6K bytes
    - Viewed (0)
  5. src/unique/handle_test.go

    	testHandle[testStringStruct](t, testStringStruct{"x"})
    	testHandle[testStringStructArrayStruct](t, testStringStructArrayStruct{
    		s: [2]testStringStruct{testStringStruct{"y"}, testStringStruct{"z"}},
    	})
    	testHandle[testStruct](t, testStruct{0.5, "184"})
    }
    
    func testHandle[T comparable](t *testing.T, value T) {
    	name := reflect.TypeFor[T]().Name()
    	t.Run(fmt.Sprintf("%s/%#v", name, value), func(t *testing.T) {
    		t.Parallel()
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Apr 22 18:14:07 UTC 2024
    - 2.5K bytes
    - Viewed (0)
  6. src/testing/quick/quick_test.go

    func fString(a string) string { return a }
    
    type TestStringAlias string
    
    func fStringAlias(a TestStringAlias) TestStringAlias { return a }
    
    type TestStruct struct {
    	A int
    	B string
    }
    
    func fStruct(a TestStruct) TestStruct { return a }
    
    type TestStructAlias TestStruct
    
    func fStructAlias(a TestStructAlias) TestStructAlias { return a }
    
    func fUint16(a uint16) uint16 { return a }
    
    type TestUint16Alias uint16
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 22 12:54:00 UTC 2019
    - 9K bytes
    - Viewed (0)
  7. src/unique/clone_test.go

    	testCloneSeq[testStringArray](t, cSeq(0, 2*goarch.PtrSize, 4*goarch.PtrSize))
    	testCloneSeq[testStringStruct](t, cSeq(0))
    	testCloneSeq[testStringStructArrayStruct](t, cSeq(0, 2*goarch.PtrSize))
    	testCloneSeq[testStruct](t, cSeq(8))
    }
    
    func cSeq(stringOffsets ...uintptr) cloneSeq {
    	return cloneSeq{stringOffsets: stringOffsets}
    }
    
    func testCloneSeq[T any](t *testing.T, want cloneSeq) {
    	typName := reflect.TypeFor[T]().Name()
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Apr 22 18:14:07 UTC 2024
    - 1K bytes
    - Viewed (0)
Back to top