()
| 322 | |
| 323 | #[test] |
| 324 | fn 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 |
nothing calls this directly
no test coverage detected