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

Function unencrypted_segment_roundtrip

nodedb/src/storage/segment.rs:473–483  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

471
472 #[test]
473 fn unencrypted_segment_roundtrip() {
474 let dir = tempfile::tempdir().unwrap();
475 let path = dir.path().join("plain.seg");
476
477 let data = b"plain data";
478 let footer = SegmentFooter::new("n", 99, Lsn::new(1), Lsn::new(5));
479
480 write_encrypted_segment(&path, data, &footer, None).unwrap();
481 let read_back = read_encrypted_segment(&path, None).unwrap();
482 assert_eq!(read_back, data);
483 }
484
485 #[test]
486 fn created_by_truncates_long_names() {

Callers

nothing calls this directly

Calls 4

write_encrypted_segmentFunction · 0.85
read_encrypted_segmentFunction · 0.85
joinMethod · 0.80
pathMethod · 0.45

Tested by

no test coverage detected