Skip to content

Commit f42d38b

Browse files
committed
Use sub test
1 parent a77e4a3 commit f42d38b

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

integrations_test.go

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,10 +242,12 @@ func TestContextifyFramesNonexistingFilesShouldNotDropFrames(t *testing.T) {
242242

243243
func TestExtractModules(t *testing.T) {
244244
tests := []struct {
245+
name string
245246
info *debug.BuildInfo
246247
expected map[string]string
247248
}{
248249
{
250+
name: "no require modules",
249251
info: &debug.BuildInfo{
250252
Main: debug.Module{
251253
Path: "my/module",
@@ -258,6 +260,7 @@ func TestExtractModules(t *testing.T) {
258260
},
259261
},
260262
{
263+
name: "have require modules",
261264
info: &debug.BuildInfo{
262265
Main: debug.Module{
263266
Path: "my/module",
@@ -268,14 +271,20 @@ func TestExtractModules(t *testing.T) {
268271
Path: "github.com/getsentry/sentry-go",
269272
Version: "v0.5.1",
270273
},
274+
{
275+
Path: "github.com/gin-gonic/gin",
276+
Version: "v1.4.0",
277+
},
271278
},
272279
},
273280
expected: map[string]string{
274281
"my/module": "(devel)",
275282
"github.com/getsentry/sentry-go": "v0.5.1",
283+
"github.com/gin-gonic/gin": "v1.4.0",
276284
},
277285
},
278286
{
287+
name: "replace module with local module",
279288
info: &debug.BuildInfo{
280289
Main: debug.Module{
281290
Path: "my/module",
@@ -297,6 +306,7 @@ func TestExtractModules(t *testing.T) {
297306
},
298307
},
299308
{
309+
name: "replace module with another remote module",
300310
info: &debug.BuildInfo{
301311
Main: debug.Module{
302312
Path: "my/module",
@@ -322,6 +332,8 @@ func TestExtractModules(t *testing.T) {
322332

323333
for _, tt := range tests {
324334
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+
})
326338
}
327339
}

0 commit comments

Comments
 (0)