(t *testing.T)
| 638 | } |
| 639 | |
| 640 | func TestLsJSONErrorWritesNoOutput(t *testing.T) { |
| 641 | cmd, stdout := testLsCmd(t) |
| 642 | setLsOutputJSON(t, cmd) |
| 643 | mock := &mockFilesClient{ |
| 644 | listFolderFn: func(arg *files.ListFolderArg) (*files.ListFolderResult, error) { |
| 645 | return nil, fmt.Errorf("list failed") |
| 646 | }, |
| 647 | } |
| 648 | stubFilesClient(t, mock) |
| 649 | |
| 650 | if err := ls(cmd, nil); err == nil { |
| 651 | t.Fatal("expected ls error") |
| 652 | } |
| 653 | if got := stdout.String(); got != "" { |
| 654 | t.Fatalf("stdout = %q, want empty output on error", got) |
| 655 | } |
| 656 | } |
| 657 | |
| 658 | func TestLsCommandSupportsStructuredOutput(t *testing.T) { |
| 659 | if !commandSupportsStructuredOutput(lsCmd) { |
nothing calls this directly
no test coverage detected