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

Function TestNewJSONOperationOutputNormalizesResults

cmd/output_test.go:752–768  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

750}
751
752func TestNewJSONOperationOutputNormalizesResults(t *testing.T) {
753 got := newJSONOperationOutput(nil, nil, nil)
754
755 encoded, err := json.Marshal(got)
756 if err != nil {
757 t.Fatalf("marshal operation output: %v", err)
758 }
759 if !strings.Contains(string(encoded), `"results":[]`) {
760 t.Fatalf("encoded output = %s, want results array", encoded)
761 }
762 if !strings.Contains(string(encoded), `"input":{}`) {
763 t.Fatalf("encoded output = %s, want input object", encoded)
764 }
765 if got.Results == nil {
766 t.Fatal("results is nil, want empty slice")
767 }
768}
769
770func TestRenderJSONOperationOutput(t *testing.T) {
771 var stdout bytes.Buffer

Callers

nothing calls this directly

Calls 1

newJSONOperationOutputFunction · 0.85

Tested by

no test coverage detected