()
| 813 | |
| 814 | #[test] |
| 815 | fn test_list_leaves() { |
| 816 | let mut txn = MockCrdtTxn::new(); |
| 817 | let branch_id = BranchId::new(NodeId::new(1), 0); |
| 818 | |
| 819 | let l1 = LeafId::new(NodeId::new(1), 0); |
| 820 | let l2 = LeafId::new(NodeId::new(1), 1); |
| 821 | |
| 822 | txn.put_leaf(&Leaf::new(l1, branch_id, TokenKind::Word, 0..2), None) |
| 823 | .unwrap(); |
| 824 | txn.put_leaf( |
| 825 | &Leaf::new(l2, branch_id, TokenKind::Whitespace, 2..3), |
| 826 | Some(l1), |
| 827 | ) |
| 828 | .unwrap(); |
| 829 | |
| 830 | let leaves = txn.list_leaves(branch_id).unwrap(); |
| 831 | assert_eq!(leaves.len(), 2); |
| 832 | } |
| 833 | |
| 834 | #[test] |
| 835 | fn test_update_leaf_content() { |
nothing calls this directly
no test coverage detected