()
| 844 | |
| 845 | #[test] |
| 846 | fn test_get_contents_empty_vertex() { |
| 847 | let store = MemoryChangeStore::new(); |
| 848 | let change = create_test_change("Empty node", b"data"); |
| 849 | let hash = change.hash().unwrap(); |
| 850 | store.insert(hash, change); |
| 851 | |
| 852 | let node_id = NodeId::new(1); |
| 853 | let hash_fn = move |id: NodeId| { |
| 854 | if id == node_id { |
| 855 | Some(hash) |
| 856 | } else { |
| 857 | None |
| 858 | } |
| 859 | }; |
| 860 | |
| 861 | // Empty range (start == end) |
| 862 | let node = GraphNode::new(node_id, ChangePosition::new(5), ChangePosition::new(5)); |
| 863 | let mut buf = vec![0u8; 0]; |
| 864 | |
| 865 | let n = store.get_contents(hash_fn, node, &mut buf).unwrap(); |
| 866 | assert_eq!(n, 0); |
| 867 | } |
| 868 | |
| 869 | #[test] |
| 870 | fn test_get_contents_root_vertex() { |
nothing calls this directly
no test coverage detected