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

Function TestCommonSig

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

Source from the content-addressed store, hash-verified

140}
141
142func TestCommonSig(t *testing.T) {
143 tests := []struct {
144 Sigs []CommonSig
145 CommonSig
146 }{
147 {
148 Sigs: []CommonSig{
149 CommonSig{}, // f()
150 },
151 CommonSig: CommonSig{}, // f()
152 },
153 {
154 Sigs: []CommonSig{
155 CommonSig{Throws: true, HasRet: true, Ret: &Type{Kind: Int}}, // int f() throws
156 },
157 // int f() throws
158 CommonSig: CommonSig{Throws: true, HasRet: true, Ret: &Type{Kind: Int}},
159 },
160 {
161 Sigs: []CommonSig{
162 CommonSig{}, // f()
163 CommonSig{Params: []*Type{&Type{Kind: Int}}}, // f(int)
164 },
165 CommonSig: CommonSig{ // f(int...)
166 Variadic: true,
167 Params: []*Type{&Type{Kind: Int}},
168 },
169 },
170 {
171 Sigs: []CommonSig{
172 CommonSig{Params: []*Type{&Type{Kind: Int}}}, // f(int)
173 CommonSig{Params: []*Type{&Type{Kind: Float}}}, // f(float)
174 },
175 CommonSig: CommonSig{ // f(interface{})
176 Params: []*Type{nil},
177 },
178 },
179 {
180 Sigs: []CommonSig{
181 CommonSig{Params: []*Type{&Type{Kind: Int}}}, // f(int)
182 CommonSig{Params: []*Type{&Type{Kind: Int}, &Type{Kind: Int}}}, // f(int, int)
183 },
184 CommonSig: CommonSig{ // f(int, int...)
185 Variadic: true,
186 Params: []*Type{&Type{Kind: Int}, &Type{Kind: Int}},
187 },
188 },
189 {
190 Sigs: []CommonSig{
191 CommonSig{Params: []*Type{&Type{Kind: Object, Class: "A"}}}, // f(A)
192 CommonSig{Params: []*Type{&Type{Kind: Object, Class: "B"}}}, // f(B)
193 },
194 CommonSig: CommonSig{ // f(A)
195 Params: []*Type{&Type{Kind: Object, Class: "A"}},
196 },
197 },
198 }
199 clsMap := testClsMap()

Callers

nothing calls this directly

Calls 2

testClsMapFunction · 0.85
combineSigsFunction · 0.85

Tested by

no test coverage detected