()
| 998 | |
| 999 | #[test] |
| 1000 | fn test_workspace_parent_child() { |
| 1001 | let mut workspace = Workspace::new(); |
| 1002 | let parent = Position::ROOT; |
| 1003 | let child1 = Position::new(NodeId::new(1), ChangePosition::new(0)); |
| 1004 | let child2 = Position::new(NodeId::new(2), ChangePosition::new(0)); |
| 1005 | |
| 1006 | workspace.set_parent(child1, parent); |
| 1007 | workspace.set_parent(child2, parent); |
| 1008 | |
| 1009 | assert_eq!(workspace.get_parent(&child1), Some(parent)); |
| 1010 | assert_eq!(workspace.get_parent(&child2), Some(parent)); |
| 1011 | |
| 1012 | let children = workspace.get_children(&parent).unwrap(); |
| 1013 | assert_eq!(children.len(), 2); |
| 1014 | assert!(children.contains(&child1)); |
| 1015 | assert!(children.contains(&child2)); |
| 1016 | } |
| 1017 | |
| 1018 | #[test] |
| 1019 | fn test_workspace_no_parent() { |
nothing calls this directly
no test coverage detected