| 191 | |
| 192 | #[test] |
| 193 | fn test_full_hierarchy() { |
| 194 | let change_id = NodeId::new(1); |
| 195 | |
| 196 | // Create trunk (file) |
| 197 | let trunk = Trunk::new( |
| 198 | TrunkId::new(change_id, 0), |
| 199 | Inode::new(1), |
| 200 | "test.rs".to_string(), |
| 201 | Some(Encoding::Utf8), |
| 202 | ); |
| 203 | |
| 204 | // Create branch (line) |
| 205 | let branch = Branch::new(BranchId::new(change_id, 0), trunk.id()); |
| 206 | |
| 207 | // Create leaf (token) |
| 208 | let leaf = Leaf::new( |
| 209 | LeafId::new(change_id, 0), |
| 210 | branch.id(), |
| 211 | TokenKind::Word, |
| 212 | 0..4, |
| 213 | ); |
| 214 | |
| 215 | // Verify hierarchy |
| 216 | assert_eq!(leaf.branch(), branch.id()); |
| 217 | assert_eq!(branch.trunk(), trunk.id()); |
| 218 | |
| 219 | // Verify all are alive |
| 220 | assert!(trunk.state().is_alive()); |
| 221 | assert!(branch.state().is_alive()); |
| 222 | assert!(leaf.state().is_alive()); |
| 223 | } |
| 224 | |
| 225 | #[test] |
| 226 | fn test_operations_create() { |