()
| 328 | |
| 329 | #[test] |
| 330 | fn test_pristine_reopen() { |
| 331 | let dir = tempdir().unwrap(); |
| 332 | let db_path = dir.path().join("pristine"); |
| 333 | |
| 334 | // Create and populate |
| 335 | { |
| 336 | let pristine = Pristine::open(&db_path).unwrap(); |
| 337 | assert_eq!(pristine.peek_next_node_id(), 1); |
| 338 | |
| 339 | // Allocate some IDs |
| 340 | pristine.alloc_node_id(); |
| 341 | pristine.alloc_node_id(); |
| 342 | pristine.alloc_node_id(); |
| 343 | } |
| 344 | |
| 345 | // Reopen - counters won't persist unless we actually write data |
| 346 | // This is expected - the counters are derived from the data |
| 347 | { |
| 348 | let pristine = Pristine::open(&db_path).unwrap(); |
| 349 | // Since we didn't actually write any changes, counter resets |
| 350 | assert_eq!(pristine.peek_next_node_id(), 1); |
| 351 | } |
| 352 | } |
| 353 | |
| 354 | #[test] |
| 355 | fn test_alloc_node_id() { |
nothing calls this directly
no test coverage detected