MCPcopy
hub / github.com/cli/cli / TestCopilotReviewerReplacer_ReplaceSlice

Function TestCopilotReviewerReplacer_ReplaceSlice

pkg/cmd/pr/shared/params_test.go:363–392  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

361}
362
363func 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
394func Test_QueryHasStateClause(t *testing.T) {
395 tests := []struct {

Callers

nothing calls this directly

Calls 4

EqualMethod · 0.80
RunMethod · 0.65
ReplaceSliceMethod · 0.45

Tested by

no test coverage detected