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