(t *testing.T)
| 11 | ) |
| 12 | |
| 13 | func TestIndexMarshalUnmarshal(t *testing.T) { |
| 14 | tests := []struct { |
| 15 | idx *TenantIndex |
| 16 | }{ |
| 17 | { |
| 18 | idx: &TenantIndex{}, |
| 19 | }, |
| 20 | { |
| 21 | idx: &TenantIndex{ |
| 22 | CreatedAt: time.Now(), |
| 23 | Meta: []*BlockMeta{ |
| 24 | NewBlockMeta("test", uuid.New(), "v1"), |
| 25 | NewBlockMeta("test", uuid.New(), "v2"), |
| 26 | NewBlockMeta("test", uuid.New(), "v3"), |
| 27 | }, |
| 28 | }, |
| 29 | }, |
| 30 | { |
| 31 | idx: &TenantIndex{ |
| 32 | CreatedAt: time.Now(), |
| 33 | CompactedMeta: []*CompactedBlockMeta{ |
| 34 | { |
| 35 | BlockMeta: *NewBlockMeta("test", uuid.New(), "v1"), |
| 36 | CompactedTime: time.Now(), |
| 37 | }, |
| 38 | { |
| 39 | BlockMeta: *NewBlockMeta("test", uuid.New(), "v1"), |
| 40 | CompactedTime: time.Now(), |
| 41 | }, |
| 42 | { |
| 43 | BlockMeta: *NewBlockMeta("test", uuid.New(), "v1"), |
| 44 | CompactedTime: time.Now(), |
| 45 | }, |
| 46 | }, |
| 47 | }, |
| 48 | }, |
| 49 | { |
| 50 | idx: &TenantIndex{ |
| 51 | Meta: []*BlockMeta{ |
| 52 | NewBlockMeta("test", uuid.New(), "v1"), |
| 53 | NewBlockMeta("test", uuid.New(), "v2"), |
| 54 | NewBlockMeta("test", uuid.New(), "v3"), |
| 55 | }, |
| 56 | CompactedMeta: []*CompactedBlockMeta{ |
| 57 | { |
| 58 | BlockMeta: *NewBlockMeta("test", uuid.New(), "v1"), |
| 59 | CompactedTime: time.Now(), |
| 60 | }, |
| 61 | { |
| 62 | BlockMeta: *NewBlockMeta("test", uuid.New(), "v1"), |
| 63 | CompactedTime: time.Now(), |
| 64 | }, |
| 65 | { |
| 66 | BlockMeta: *NewBlockMeta("test", uuid.New(), "v1"), |
| 67 | CompactedTime: time.Now(), |
| 68 | }, |
| 69 | }, |
| 70 | }, |
nothing calls this directly
no test coverage detected