MCPcopy Create free account
hub / github.com/cli/cli / Test_scopesSentence

Function Test_scopesSentence

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

Source from the content-addressed store, hash-verified

391}
392
393func Test_scopesSentence(t *testing.T) {
394 type args struct {
395 scopes []string
396 }
397 tests := []struct {
398 name string
399 args args
400 want string
401 }{
402 {
403 name: "basic scopes",
404 args: args{
405 scopes: []string{"repo", "read:org"},
406 },
407 want: "'repo', 'read:org'",
408 },
409 {
410 name: "empty",
411 args: args{
412 scopes: []string(nil),
413 },
414 want: "",
415 },
416 {
417 name: "workflow scope",
418 args: args{
419 scopes: []string{"repo", "workflow"},
420 },
421 want: "'repo', 'workflow'",
422 },
423 }
424 for _, tt := range tests {
425 t.Run(tt.name, func(t *testing.T) {
426 if got := scopesSentence(tt.args.scopes); got != tt.want {
427 t.Errorf("scopesSentence() = %q, want %q", got, tt.want)
428 }
429 })
430 }
431}

Callers

nothing calls this directly

Calls 3

scopesSentenceFunction · 0.85
RunMethod · 0.65
ErrorfMethod · 0.65

Tested by

no test coverage detected