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

Function Test_scopesSentence

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

Source from the content-addressed store, hash-verified

945}
946
947func Test_scopesSentence(t *testing.T) {
948 type args struct {
949 scopes []string
950 }
951 tests := []struct {
952 name string
953 args args
954 want string
955 }{
956 {
957 name: "basic scopes",
958 args: args{
959 scopes: []string{"repo", "read:org"},
960 },
961 want: "'repo', 'read:org'",
962 },
963 {
964 name: "empty",
965 args: args{
966 scopes: []string(nil),
967 },
968 want: "",
969 },
970 {
971 name: "workflow scope",
972 args: args{
973 scopes: []string{"repo", "workflow"},
974 },
975 want: "'repo', 'workflow'",
976 },
977 }
978 for _, tt := range tests {
979 t.Run(tt.name, func(t *testing.T) {
980 if got := scopesSentence(tt.args.scopes); got != tt.want {
981 t.Errorf("scopesSentence() = %q, want %q", got, tt.want)
982 }
983 })
984 }
985}

Callers

nothing calls this directly

Calls 3

scopesSentenceFunction · 0.85
RunMethod · 0.65
ErrorfMethod · 0.65

Tested by

no test coverage detected