Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 4 of 4 for TestAssignableTo (0.29 sec)

  1. src/internal/reflectlite/set_test.go

    	{new(IntPtr), new(*int), true},
    	{new(IntPtr), new(IntPtr1), false},
    	{new(Ch), new(<-chan any), true},
    	// test runs implementsTests too
    }
    
    type IntPtr *int
    type IntPtr1 *int
    type Ch <-chan any
    
    func TestAssignableTo(t *testing.T) {
    	for i, tt := range append(assignableTests, implementsTests...) {
    		xv := TypeOf(tt.x).Elem()
    		xt := TypeOf(tt.t).Elem()
    		if b := xv.AssignableTo(xt); b != tt.b {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Dec 13 18:45:54 UTC 2021
    - 2.4K bytes
    - Viewed (0)
  2. src/reflect/set_test.go

    	{new(IntPtr), new(IntPtr1), false},
    	{new(Ch), new(<-chan any), true},
    	// test runs implementsTests too
    }
    
    type IntPtr *int
    type IntPtr1 *int
    type Ch <-chan any
    
    func TestAssignableTo(t *testing.T) {
    	for _, tt := range append(assignableTests, implementsTests...) {
    		xv := TypeOf(tt.x).Elem()
    		xt := TypeOf(tt.t).Elem()
    		if b := xv.AssignableTo(xt); b != tt.b {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Sep 07 13:56:11 UTC 2022
    - 5.7K bytes
    - Viewed (0)
  3. src/cmd/compile/internal/types2/api_test.go

    	} {
    		if got := ConvertibleTo(test.v, test.t); got != test.want {
    			t.Errorf("ConvertibleTo(%v, %v) = %t, want %t", test.v, test.t, got, test.want)
    		}
    	}
    }
    
    func TestAssignableTo(t *testing.T) {
    	for _, test := range []struct {
    		v, t Type
    		want bool
    	}{
    		{Typ[Int], Typ[Int], true},
    		{Typ[Int], Typ[Float32], false},
    		{newDefined(Typ[Int]), Typ[Int], false},
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue May 07 20:08:23 UTC 2024
    - 93.3K bytes
    - Viewed (0)
  4. src/go/types/api_test.go

    	} {
    		if got := ConvertibleTo(test.v, test.t); got != test.want {
    			t.Errorf("ConvertibleTo(%v, %v) = %t, want %t", test.v, test.t, got, test.want)
    		}
    	}
    }
    
    func TestAssignableTo(t *testing.T) {
    	for _, test := range []struct {
    		v, t Type
    		want bool
    	}{
    		{Typ[Int], Typ[Int], true},
    		{Typ[Int], Typ[Float32], false},
    		{newDefined(Typ[Int]), Typ[Int], false},
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 01:00:11 UTC 2024
    - 94.2K bytes
    - Viewed (0)
Back to top