(t *testing.T)
| 242 | } |
| 243 | |
| 244 | func TestGzip(t *testing.T) { |
| 245 | tmpStore := NewSimpleInMemoryStore() |
| 246 | tmpStore.Add(atom("i(/persist, '%%')")) |
| 247 | tmpStore.Add(atom("we(/persist)")) |
| 248 | var b bytes.Buffer |
| 249 | w := gzip.NewWriter(&b) |
| 250 | sc := SimpleColumn{} |
| 251 | if err := sc.WriteTo(tmpStore, w); err != nil { |
| 252 | t.Fatal(err) |
| 253 | } |
| 254 | if err := w.Close(); err != nil { |
| 255 | t.Fatal(err) |
| 256 | } |
| 257 | store, err := NewSimpleColumnStoreFromGzipBytes(b.Bytes()) |
| 258 | if err != nil { |
| 259 | t.Fatal(err) |
| 260 | } |
| 261 | if diff := cmp.Diff(tmpStore.ListPredicates(), store.ListPredicates(), |
| 262 | cmpopts.SortSlices(sortBySymbol)); diff != "" { |
| 263 | t.Errorf("NewSimpleColumnStoreFromGzipBytes: diff (-want +got) %v", diff) |
| 264 | } |
| 265 | if !store.Contains(atom("i(/persist, '%%')")) { |
| 266 | t.Errorf("NewSimpleColumnStoreFromGzipBytes: expected atom i(/persist, '%%')") |
| 267 | } |
| 268 | if !store.Contains(atom("we(/persist)")) { |
| 269 | t.Errorf("NewSimpleColumnStoreFromGzipBytes: expected atom i(/persist)") |
| 270 | } |
| 271 | } |
nothing calls this directly
no test coverage detected