MCPcopy Index your code
hub / github.com/bootdotdev/bootdev / TestParseJqInputRejectsMultipleJSONValuesInJSONMode

Function TestParseJqInputRejectsMultipleJSONValuesInJSONMode

checks/jq_test.go:90–98  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

88}
89
90func TestParseJqInputRejectsMultipleJSONValuesInJSONMode(t *testing.T) {
91 _, err := parseJqInput("{\"id\":1}\n{\"id\":2}\n", "json")
92 if err == nil {
93 t.Fatal("expected error for multiple JSON values in json mode")
94 }
95 if err.Error() != "expected a single JSON value" {
96 t.Fatalf("expected single-value error, got %q", err.Error())
97 }
98}
99
100func TestFormatJqResults(t *testing.T) {
101 got := formatJqResults([]any{"hello", float64(42), true, nil, map[string]any{"id": float64(1)}})

Callers

nothing calls this directly

Calls 1

parseJqInputFunction · 0.85

Tested by

no test coverage detected