(t *testing.T)
| 30 | } |
| 31 | |
| 32 | func TestMcpErrorData_Map(t *testing.T) { |
| 33 | input := map[string]any{"error": "something went wrong", "code": 42} |
| 34 | result := mcpErrorData(input) |
| 35 | if result == nil { |
| 36 | t.Fatal("mcpErrorData(map) = nil, want non-nil") |
| 37 | } |
| 38 | var got map[string]any |
| 39 | if err := json.Unmarshal(result, &got); err != nil { |
| 40 | t.Fatalf("failed to unmarshal result: %v", err) |
| 41 | } |
| 42 | if got["error"] != "something went wrong" { |
| 43 | t.Errorf("mcpErrorData map[\"error\"] = %v, want %q", got["error"], "something went wrong") |
| 44 | } |
| 45 | } |
| 46 | |
| 47 | func TestMcpErrorData_UnmarshalableType(t *testing.T) { |
| 48 | // channels cannot be marshaled to JSON |
nothing calls this directly
no test coverage detected