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