MCPcopy Create free account
hub / github.com/basecamp/hey-cli / TestNormalizeJSONNumbers

Function TestNormalizeJSONNumbers

internal/output/writer_test.go:166–177  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

164}
165
166func TestNormalizeJSONNumbers(t *testing.T) {
167 data := []byte(`{"id": 1234567890123456789}`)
168 v, err := NormalizeJSONNumbers(data)
169 if err != nil {
170 t.Fatal(err)
171 }
172 m := v.(map[string]any)
173 // Should preserve as json.Number, not float64
174 if _, ok := m["id"].(json.Number); !ok {
175 t.Errorf("expected json.Number, got %T", m["id"])
176 }
177}

Callers

nothing calls this directly

Calls 1

NormalizeJSONNumbersFunction · 0.85

Tested by

no test coverage detected