(t *testing.T)
| 53 | } |
| 54 | |
| 55 | func TestFormatCollisions(t *testing.T) { |
| 56 | tests := []struct { |
| 57 | name string |
| 58 | collisions []NameCollision |
| 59 | want string |
| 60 | }{ |
| 61 | { |
| 62 | name: "formats multiple collisions", |
| 63 | collisions: []NameCollision{ |
| 64 | {Name: "pr-summary", DisplayNames: []string{"skills/pr-summary", "plugins/hubot/pr-summary"}}, |
| 65 | {Name: "code-review", DisplayNames: []string{"skills/code-review", "skills/monalisa/code-review"}}, |
| 66 | }, |
| 67 | want: "pr-summary: skills/pr-summary, plugins/hubot/pr-summary\n code-review: skills/code-review, skills/monalisa/code-review", |
| 68 | }, |
| 69 | { |
| 70 | name: "nil input returns empty string", |
| 71 | collisions: nil, |
| 72 | want: "", |
| 73 | }, |
| 74 | } |
| 75 | for _, tt := range tests { |
| 76 | t.Run(tt.name, func(t *testing.T) { |
| 77 | assert.Equal(t, tt.want, FormatCollisions(tt.collisions)) |
| 78 | }) |
| 79 | } |
| 80 | } |
nothing calls this directly
no test coverage detected