MCPcopy Create free account
hub / github.com/dropbox/dbxcli / TestRenderTextRequiresTextFormat

Function TestRenderTextRequiresTextFormat

internal/output/output_test.go:73–85  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

71}
72
73func TestRenderTextRequiresTextFormat(t *testing.T) {
74 out := New(nil, nil, FormatJSON)
75
76 err := out.RenderText(func(w io.Writer) error {
77 return nil
78 })
79 if err == nil {
80 t.Fatal("expected error for text-only renderer in JSON format")
81 }
82 if !errors.Is(err, ErrStructuredOutputUnsupported) {
83 t.Fatalf("error = %q, want ErrStructuredOutputUnsupported", err.Error())
84 }
85}
86
87func TestRenderJSON(t *testing.T) {
88 var stdout bytes.Buffer

Callers

nothing calls this directly

Calls 3

NewFunction · 0.85
RenderTextMethod · 0.80
ErrorMethod · 0.45

Tested by

no test coverage detected