()
| 735 | /// Test inode allocation works correctly. |
| 736 | #[test] |
| 737 | fn test_inode_allocation() { |
| 738 | let change_id = NodeId::new(1); |
| 739 | |
| 740 | let mut txn = MockCrdtTxn::new(); |
| 741 | let mut ctx = ApplyContext::new(ApplyOptions::default()); |
| 742 | |
| 743 | // Create multiple files and verify unique inodes |
| 744 | for i in 0..5 { |
| 745 | let trunk_id = TrunkId::new(change_id, i); |
| 746 | let create_op = TrunkOp::Create { |
| 747 | path: format!("file{}.rs", i), |
| 748 | encoding: Some(Encoding::Utf8), |
| 749 | }; |
| 750 | apply_trunk_op(&mut txn, &mut ctx, trunk_id, &create_op).unwrap(); |
| 751 | } |
| 752 | |
| 753 | // Verify all files have unique inodes |
| 754 | let mut inodes = std::collections::HashSet::new(); |
| 755 | for i in 0..5 { |
| 756 | let trunk_id = TrunkId::new(change_id, i); |
| 757 | let trunk = txn.get_trunk(trunk_id).unwrap().unwrap(); |
| 758 | assert!(inodes.insert(trunk.inode()), "Duplicate inode detected!"); |
| 759 | } |
| 760 | } |
| 761 | |
| 762 | /// Test full workflow: multiple files, lines, and tokens. |
| 763 | #[test] |
nothing calls this directly
no test coverage detected