@@ -242,10 +242,12 @@ func TestContextifyFramesNonexistingFilesShouldNotDropFrames(t *testing.T) {
242
242
243
243
func TestExtractModules (t * testing.T ) {
244
244
tests := []struct {
245
+ name string
245
246
info * debug.BuildInfo
246
247
expected map [string ]string
247
248
}{
248
249
{
250
+ name : "no require modules" ,
249
251
info : & debug.BuildInfo {
250
252
Main : debug.Module {
251
253
Path : "my/module" ,
@@ -258,6 +260,7 @@ func TestExtractModules(t *testing.T) {
258
260
},
259
261
},
260
262
{
263
+ name : "have require modules" ,
261
264
info : & debug.BuildInfo {
262
265
Main : debug.Module {
263
266
Path : "my/module" ,
@@ -268,14 +271,20 @@ func TestExtractModules(t *testing.T) {
268
271
Path : "github.com/getsentry/sentry-go" ,
269
272
Version : "v0.5.1" ,
270
273
},
274
+ {
275
+ Path : "github.com/gin-gonic/gin" ,
276
+ Version : "v1.4.0" ,
277
+ },
271
278
},
272
279
},
273
280
expected : map [string ]string {
274
281
"my/module" : "(devel)" ,
275
282
"github.com/getsentry/sentry-go" : "v0.5.1" ,
283
+ "github.com/gin-gonic/gin" : "v1.4.0" ,
276
284
},
277
285
},
278
286
{
287
+ name : "replace module with local module" ,
279
288
info : & debug.BuildInfo {
280
289
Main : debug.Module {
281
290
Path : "my/module" ,
@@ -297,6 +306,7 @@ func TestExtractModules(t *testing.T) {
297
306
},
298
307
},
299
308
{
309
+ name : "replace module with another remote module" ,
300
310
info : & debug.BuildInfo {
301
311
Main : debug.Module {
302
312
Path : "my/module" ,
@@ -322,6 +332,8 @@ func TestExtractModules(t *testing.T) {
322
332
323
333
for _ , tt := range tests {
324
334
tt := tt
325
- assertEqual (t , tt .expected , extractModules (tt .info ))
335
+ t .Run (tt .name , func (t * testing.T ) {
336
+ assertEqual (t , tt .expected , extractModules (tt .info ))
337
+ })
326
338
}
327
339
}
0 commit comments