(t *testing.T)
| 383 | } |
| 384 | |
| 385 | func TestInvalidSampleHistogramPairJSON(t *testing.T) { |
| 386 | s1 := SampleHistogramPair{ |
| 387 | Timestamp: 1, |
| 388 | Histogram: nil, |
| 389 | } |
| 390 | d, err := json.Marshal(s1) |
| 391 | if err == nil { |
| 392 | t.Errorf("expected error when trying to marshal invalid SampleHistogramPair %s", string(d)) |
| 393 | } |
| 394 | |
| 395 | var s2 SampleHistogramPair |
| 396 | plain := "[0.001,null]" |
| 397 | err = json.Unmarshal([]byte(plain), &s2) |
| 398 | if err == nil { |
| 399 | t.Errorf("expected error when trying to unmarshal invalid SampleHistogramPair %s", plain) |
| 400 | } |
| 401 | } |
| 402 | |
| 403 | func TestSampleHistogramJSON(t *testing.T) { |
| 404 | input := []struct { |
nothing calls this directly
no outgoing calls
no test coverage detected