MCPcopy
hub / github.com/dosco/graphjin / TestResponseProcessor_MalformedJSON

Function TestResponseProcessor_MalformedJSON

core/cache_response_test.go:608–620  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

606}
607
608func TestResponseProcessor_MalformedJSON(t *testing.T) {
609 qc := &qcode.QCode{
610 Selects: []qcode.Select{},
611 }
612 rp := NewResponseProcessor(qc)
613
614 // Invalid JSON should return error
615 input := []byte(`{"data": invalid}`)
616 _, _, err := rp.ProcessForCache(input)
617 if err == nil {
618 t.Errorf("expected error for malformed JSON")
619 }
620}
621
622func TestResponseProcessor_MissingGjId(t *testing.T) {
623 // Test that objects without __gj_id are handled gracefully

Callers

nothing calls this directly

Calls 2

ProcessForCacheMethod · 0.95
NewResponseProcessorFunction · 0.85

Tested by

no test coverage detected