(t *testing.T)
| 62 | } |
| 63 | |
| 64 | func TestSamplePairJSONV2(t *testing.T) { |
| 65 | cases := []SamplePair{ |
| 66 | {}, |
| 67 | {Timestamp: Time(1)}, |
| 68 | {Value: SampleValue(1)}, |
| 69 | {Timestamp: Time(1), Value: SampleValue(1)}, |
| 70 | } |
| 71 | |
| 72 | for _, v := range cases { |
| 73 | testV1V2Marshal(t, fmt.Sprintf("%#v", v), v) |
| 74 | testRoundTrip(t, fmt.Sprintf("%#v", v), v) |
| 75 | } |
| 76 | |
| 77 | for _, input := range []string{`null`, `[]`, `[1.123]`, `[1.123,"2"]`, `[null,"2"]`, `[1.123,null]`, `[1.123,"2","bogus","trailing","data"]`} { |
| 78 | testDecodeSuccessParity(t, input, func() *SamplePair { return &SamplePair{Timestamp: Time(9), Value: SampleValue(9)} }) |
| 79 | } |
| 80 | for _, input := range []string{`[`, `[1.123,"2" true`, `{}`} { |
| 81 | testDecodeErrorParity(t, input, func() *SamplePair { return &SamplePair{Timestamp: Time(9), Value: SampleValue(9)} }) |
| 82 | } |
| 83 | } |
nothing calls this directly
no test coverage detected