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