()
| 1112 | |
| 1113 | #[test] |
| 1114 | fn test_pristine_reopen() { |
| 1115 | let dir = tempdir().unwrap(); |
| 1116 | let db_path = dir.path().join("pristine"); |
| 1117 | |
| 1118 | // Create and populate |
| 1119 | { |
| 1120 | let pristine = Pristine::open(&db_path).unwrap(); |
| 1121 | assert_eq!(pristine.peek_next_node_id(), 1); |
| 1122 | |
| 1123 | // Allocate some IDs |
| 1124 | pristine.alloc_node_id(); |
| 1125 | pristine.alloc_node_id(); |
| 1126 | pristine.alloc_node_id(); |
| 1127 | } |
| 1128 | |
| 1129 | // Reopen - counters won't persist unless we actually write data |
| 1130 | // This is expected - the counters are derived from the data |
| 1131 | { |
| 1132 | let pristine = Pristine::open(&db_path).unwrap(); |
| 1133 | // Since we didn't actually write any changes, counter resets |
| 1134 | assert_eq!(pristine.peek_next_node_id(), 1); |
| 1135 | } |
| 1136 | } |
| 1137 | |
| 1138 | #[test] |
| 1139 | fn test_reopen_allocates_after_unbound_tree_inodes() { |
nothing calls this directly
no test coverage detected