(t *testing.T)
| 361 | } |
| 362 | |
| 363 | func TestCopilotReviewerReplacer_ReplaceSlice(t *testing.T) { |
| 364 | tests := []struct { |
| 365 | name string |
| 366 | handles []string |
| 367 | want []string |
| 368 | }{ |
| 369 | { |
| 370 | name: "replaces @copilot with reviewer login", |
| 371 | handles: []string{"monalisa", "@copilot", "hubot"}, |
| 372 | want: []string{"monalisa", "copilot-pull-request-reviewer", "hubot"}, |
| 373 | }, |
| 374 | { |
| 375 | name: "handles @copilot case-insensitively", |
| 376 | handles: []string{"@Copilot", "user", "@CoPiLoT"}, |
| 377 | want: []string{"copilot-pull-request-reviewer", "user", "copilot-pull-request-reviewer"}, |
| 378 | }, |
| 379 | { |
| 380 | name: "handles no @copilot mentions", |
| 381 | handles: []string{"monalisa", "user", "hubot"}, |
| 382 | want: []string{"monalisa", "user", "hubot"}, |
| 383 | }, |
| 384 | } |
| 385 | for _, tt := range tests { |
| 386 | t.Run(tt.name, func(t *testing.T) { |
| 387 | r := NewCopilotReviewerReplacer() |
| 388 | got := r.ReplaceSlice(tt.handles) |
| 389 | require.Equal(t, tt.want, got) |
| 390 | }) |
| 391 | } |
| 392 | } |
| 393 | |
| 394 | func Test_QueryHasStateClause(t *testing.T) { |
| 395 | tests := []struct { |
nothing calls this directly
no test coverage detected