()
| 737 | |
| 738 | #[test] |
| 739 | fn test_update_trunk_path() { |
| 740 | let mut txn = MockCrdtTxn::new(); |
| 741 | let id = TrunkId::new(NodeId::new(1), 0); |
| 742 | let trunk = Trunk::new(id, Inode::new(1), "old.rs".to_string(), None); |
| 743 | |
| 744 | txn.put_trunk(&trunk).unwrap(); |
| 745 | txn.update_trunk_path(id, "new.rs").unwrap(); |
| 746 | |
| 747 | let retrieved = txn.get_trunk(id).unwrap().unwrap(); |
| 748 | assert_eq!(retrieved.path(), "new.rs"); |
| 749 | |
| 750 | // Old path should not work |
| 751 | assert!(txn.get_trunk_by_path("old.rs").unwrap().is_none()); |
| 752 | // New path should work |
| 753 | assert_eq!(txn.get_trunk_by_path("new.rs").unwrap(), Some(id)); |
| 754 | } |
| 755 | |
| 756 | // Branch Tests |
| 757 |
nothing calls this directly
no test coverage detected