MCPcopy Create free account
hub / github.com/NodeDB-Lab/nodedb / reader_round_trips_sparse_tiles

Function reader_round_trips_sparse_tiles

nodedb-array/src/segment/reader.rs:418–433  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

416
417 #[test]
418 fn reader_round_trips_sparse_tiles() {
419 let s = schema();
420 let mut w = SegmentWriter::new(0xCAFE);
421 w.append_sparse(TileId::snapshot(1), &make_sparse(&s, 1))
422 .unwrap();
423 w.append_sparse(TileId::snapshot(2), &make_sparse(&s, 2))
424 .unwrap();
425 let bytes = w.finish(None).unwrap();
426 let r = SegmentReader::open(&bytes).unwrap();
427 assert_eq!(r.tile_count(), 2);
428 let t0 = r.read_tile(0).unwrap();
429 match t0 {
430 TilePayload::Sparse(t) => assert_eq!(t.nnz(), 1),
431 _ => panic!("expected sparse"),
432 }
433 }
434
435 #[test]
436 fn reader_round_trips_dense_tile() {

Callers

nothing calls this directly

Calls 7

snapshotFunction · 0.85
make_sparseFunction · 0.85
append_sparseMethod · 0.80
read_tileMethod · 0.80
schemaFunction · 0.70
openFunction · 0.50
finishMethod · 0.45

Tested by

no test coverage detected