(t *testing.T)
| 393 | } |
| 394 | |
| 395 | func Test_detectEmptyFiles(t *testing.T) { |
| 396 | tests := []struct { |
| 397 | content string |
| 398 | isEmptyFile bool |
| 399 | }{ |
| 400 | { |
| 401 | content: "{}", |
| 402 | isEmptyFile: false, |
| 403 | }, |
| 404 | { |
| 405 | content: "\n\t", |
| 406 | isEmptyFile: true, |
| 407 | }, |
| 408 | } |
| 409 | |
| 410 | for _, tt := range tests { |
| 411 | files := map[string]*shared.GistFile{} |
| 412 | files["file"] = &shared.GistFile{ |
| 413 | Content: tt.content, |
| 414 | } |
| 415 | |
| 416 | isEmptyFile := detectEmptyFiles(files) |
| 417 | assert.Equal(t, tt.isEmptyFile, isEmptyFile) |
| 418 | } |
| 419 | } |
| 420 | |
| 421 | // Test_createGist_missingScope pins the scopes suggestion, which is the reason this call site |
| 422 | // declares the gist scope rather than relying on what the API reports. |
nothing calls this directly
no test coverage detected