(t *testing.T)
| 15 | ) |
| 16 | |
| 17 | func TestDecodeLabelOrder(t *testing.T) { |
| 18 | j := JsonDecoder{} |
| 19 | |
| 20 | decoded := j.vectorToPromQLVector( |
| 21 | model.Vector{ |
| 22 | { |
| 23 | Metric: model.Metric{ |
| 24 | "foo": "bar", |
| 25 | "a": "b", |
| 26 | "b": "b", |
| 27 | }, |
| 28 | Timestamp: 1724146338123, |
| 29 | Value: 1.234, |
| 30 | }, |
| 31 | }, |
| 32 | ) |
| 33 | require.Equal(t, 1, len(decoded)) |
| 34 | require.Equal(t, int64(1724146338123), decoded[0].T) |
| 35 | require.Equal(t, 1.234, decoded[0].F) |
| 36 | require.Equal(t, labels.FromStrings("a", "b", "b", "b", "foo", "bar"), decoded[0].Metric) |
| 37 | } |
| 38 | |
| 39 | func TestProtoDecode(t *testing.T) { |
| 40 | tests := []struct { |
nothing calls this directly
no test coverage detected