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

Function Test_scopesSentence

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

Source from the content-addressed store, hash-verified

926}
927
928func Test_scopesSentence(t *testing.T) {
929 type args struct {
930 scopes []string
931 }
932 tests := []struct {
933 name string
934 args args
935 want string
936 }{
937 {
938 name: "basic scopes",
939 args: args{
940 scopes: []string{"repo", "read:org"},
941 },
942 want: "'repo', 'read:org'",
943 },
944 {
945 name: "empty",
946 args: args{
947 scopes: []string(nil),
948 },
949 want: "",
950 },
951 {
952 name: "workflow scope",
953 args: args{
954 scopes: []string{"repo", "workflow"},
955 },
956 want: "'repo', 'workflow'",
957 },
958 }
959 for _, tt := range tests {
960 t.Run(tt.name, func(t *testing.T) {
961 if got := scopesSentence(tt.args.scopes); got != tt.want {
962 t.Errorf("scopesSentence() = %q, want %q", got, tt.want)
963 }
964 })
965 }
966}

Callers

nothing calls this directly

Calls 3

scopesSentenceFunction · 0.85
RunMethod · 0.65
ErrorfMethod · 0.65

Tested by

no test coverage detected