MCPcopy Create free account
hub / github.com/golang/mobile / TestCommonTypes

Function TestCommonTypes

internal/importers/java/java_test.go:121–140  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

119}
120
121func 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
142func TestCommonSig(t *testing.T) {
143 tests := []struct {

Callers

nothing calls this directly

Calls 2

testClsMapFunction · 0.85
commonTypeFunction · 0.85

Tested by

no test coverage detected