()
| 929 | |
| 930 | #[test] |
| 931 | fn test_get_contents_ext_basic() { |
| 932 | let store = MemoryChangeStore::new(); |
| 933 | let content = b"External hash content"; |
| 934 | let change = create_test_change("Ext test", content); |
| 935 | let hash = change.hash().unwrap(); |
| 936 | store.insert(hash, change); |
| 937 | |
| 938 | let node = GraphNode::new( |
| 939 | Some(hash), |
| 940 | ChangePosition::new(0), |
| 941 | ChangePosition::new(content.len() as u64), |
| 942 | ); |
| 943 | let mut buf = vec![0u8; content.len()]; |
| 944 | |
| 945 | let n = store.get_contents_ext(node, &mut buf).unwrap(); |
| 946 | |
| 947 | assert_eq!(n, content.len()); |
| 948 | assert_eq!(&buf, content); |
| 949 | } |
| 950 | |
| 951 | #[test] |
| 952 | fn test_get_contents_ext_none_hash() { |
nothing calls this directly
no test coverage detected