MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / test_inode_isolation

Function test_inode_isolation

atomic-core/tests/inode_graph_test.rs:324–344  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

322
323#[test]
324fn test_inode_isolation() {
325 // Changes to one file's graph should not require scanning another file's graph.
326 // This is achieved by having separate key prefixes in INODE_GRAPH.
327
328 let file_a = make_inode(1);
329 let file_b = make_inode(2);
330
331 let iv_a = InodeVertex::new(file_a, make_vertex(100, 0, 10));
332 let iv_b = InodeVertex::new(file_b, make_vertex(1, 0, 10));
333
334 // Even though file_a has change 100 and file_b has change 1,
335 // file_a's vertices come first because inode 1 < inode 2
336 assert!(iv_a < iv_b);
337
338 // Range query for file_a won't touch file_b's entries
339 let min_a = InodeVertex::min_for_inode(file_a);
340 let max_a = InodeVertex::max_for_inode(file_a);
341
342 assert!(iv_a >= min_a && iv_a <= max_a);
343 assert!(!(iv_b >= min_a && iv_b <= max_a)); // file_b NOT in file_a's range
344}
345
346// Migration Stats (for populating inode_graph from existing graph)
347

Callers

nothing calls this directly

Calls 2

make_inodeFunction · 0.85
make_vertexFunction · 0.70

Tested by

no test coverage detected