(t *testing.T)
| 926 | } |
| 927 | |
| 928 | func 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 | } |
nothing calls this directly
no test coverage detected