MCPcopy
hub / github.com/cli/cli / Test_scopesSentence

Function Test_scopesSentence

pkg/cmd/auth/shared/login_flow_test.go:351–389  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

349}
350
351func Test_scopesSentence(t *testing.T) {
352 type args struct {
353 scopes []string
354 }
355 tests := []struct {
356 name string
357 args args
358 want string
359 }{
360 {
361 name: "basic scopes",
362 args: args{
363 scopes: []string{"repo", "read:org"},
364 },
365 want: "'repo', 'read:org'",
366 },
367 {
368 name: "empty",
369 args: args{
370 scopes: []string(nil),
371 },
372 want: "",
373 },
374 {
375 name: "workflow scope",
376 args: args{
377 scopes: []string{"repo", "workflow"},
378 },
379 want: "'repo', 'workflow'",
380 },
381 }
382 for _, tt := range tests {
383 t.Run(tt.name, func(t *testing.T) {
384 if got := scopesSentence(tt.args.scopes); got != tt.want {
385 t.Errorf("scopesSentence() = %q, want %q", got, tt.want)
386 }
387 })
388 }
389}

Callers

nothing calls this directly

Calls 3

scopesSentenceFunction · 0.85
RunMethod · 0.65
ErrorfMethod · 0.65

Tested by

no test coverage detected