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

Function parse_valid_segment_filename

nodedb/src/wal/archiver.rs:273–282  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

271
272 #[test]
273 fn parse_valid_segment_filename() {
274 let dir = tempfile::tempdir().unwrap();
275 let path = dir.path().join("wal-000000000000000a-0000000000000064.seg");
276 std::fs::write(&path, b"test data").unwrap();
277
278 let seg = parse_segment_filename(&path).unwrap();
279 assert_eq!(seg.first_lsn, Lsn::new(10));
280 assert_eq!(seg.last_lsn, Lsn::new(100));
281 assert_eq!(seg.size_bytes, 9);
282 }
283
284 #[test]
285 fn parse_invalid_filenames() {

Callers

nothing calls this directly

Calls 4

joinMethod · 0.80
parse_segment_filenameFunction · 0.70
writeFunction · 0.50
pathMethod · 0.45

Tested by

no test coverage detected