(t *testing.T)
| 119 | } |
| 120 | |
| 121 | func TestCommonTypes(t *testing.T) { |
| 122 | clsMap := testClsMap() |
| 123 | tests := [][3]*Type{ |
| 124 | {nil, nil, nil}, |
| 125 | {&Type{Kind: Int}, nil, nil}, |
| 126 | {&Type{Kind: Int}, &Type{Kind: Float}, nil}, |
| 127 | {&Type{Kind: Int}, &Type{Kind: Int}, &Type{Kind: Int}}, |
| 128 | {&Type{Kind: Object, Class: "D"}, &Type{Kind: Object, Class: "D"}, &Type{Kind: Object, Class: "D"}}, |
| 129 | {&Type{Kind: Object, Class: "D"}, &Type{Kind: Object, Class: "E"}, &Type{Kind: Object, Class: "C"}}, |
| 130 | {&Type{Kind: Object, Class: "D"}, &Type{Kind: Object, Class: "F"}, &Type{Kind: Object, Class: "A"}}, |
| 131 | {&Type{Kind: Object, Class: "B"}, &Type{Kind: Object, Class: "E"}, &Type{Kind: Object, Class: "A"}}, |
| 132 | } |
| 133 | for _, test := range tests { |
| 134 | t1, t2, exp := test[0], test[1], test[2] |
| 135 | got := commonType(clsMap, t1, t2) |
| 136 | if !reflect.DeepEqual(got, exp) { |
| 137 | t.Errorf("commonType(%+v, %+v) = %+v, expected %+v", t1, t2, got, exp) |
| 138 | } |
| 139 | } |
| 140 | } |
| 141 | |
| 142 | func TestCommonSig(t *testing.T) { |
| 143 | tests := []struct { |
nothing calls this directly
no test coverage detected