(t *testing.T)
| 349 | } |
| 350 | |
| 351 | func Test_scopesSentence(t *testing.T) { |
| 352 | type args struct { |
| 353 | scopes []string |
| 354 | } |
| 355 | tests := []struct { |
| 356 | name string |
| 357 | args args |
| 358 | want string |
| 359 | }{ |
| 360 | { |
| 361 | name: "basic scopes", |
| 362 | args: args{ |
| 363 | scopes: []string{"repo", "read:org"}, |
| 364 | }, |
| 365 | want: "'repo', 'read:org'", |
| 366 | }, |
| 367 | { |
| 368 | name: "empty", |
| 369 | args: args{ |
| 370 | scopes: []string(nil), |
| 371 | }, |
| 372 | want: "", |
| 373 | }, |
| 374 | { |
| 375 | name: "workflow scope", |
| 376 | args: args{ |
| 377 | scopes: []string{"repo", "workflow"}, |
| 378 | }, |
| 379 | want: "'repo', 'workflow'", |
| 380 | }, |
| 381 | } |
| 382 | for _, tt := range tests { |
| 383 | t.Run(tt.name, func(t *testing.T) { |
| 384 | if got := scopesSentence(tt.args.scopes); got != tt.want { |
| 385 | t.Errorf("scopesSentence() = %q, want %q", got, tt.want) |
| 386 | } |
| 387 | }) |
| 388 | } |
| 389 | } |
nothing calls this directly
no test coverage detected