()
| 868 | |
| 869 | #[test] |
| 870 | fn test_get_contents_empty_vertex() { |
| 871 | let store = MemoryChangeStore::new(); |
| 872 | let change = create_test_change("Empty node", b"data"); |
| 873 | let hash = change.hash().unwrap(); |
| 874 | store.insert(hash, change); |
| 875 | |
| 876 | let node_id = NodeId::new(1); |
| 877 | let hash_fn = move |id: NodeId| { |
| 878 | if id == node_id { |
| 879 | Some(hash) |
| 880 | } else { |
| 881 | None |
| 882 | } |
| 883 | }; |
| 884 | |
| 885 | // Empty range (start == end) |
| 886 | let node = GraphNode::new(node_id, ChangePosition::new(5), ChangePosition::new(5)); |
| 887 | let mut buf = vec![0u8; 0]; |
| 888 | |
| 889 | let n = store.get_contents(hash_fn, node, &mut buf).unwrap(); |
| 890 | assert_eq!(n, 0); |
| 891 | } |
| 892 | |
| 893 | #[test] |
| 894 | fn test_get_contents_root_vertex() { |
nothing calls this directly
no test coverage detected