()
| 953 | |
| 954 | #[test] |
| 955 | fn test_get_contents_ext_basic() { |
| 956 | let store = MemoryChangeStore::new(); |
| 957 | let content = b"External hash content"; |
| 958 | let change = create_test_change("Ext test", content); |
| 959 | let hash = change.hash().unwrap(); |
| 960 | store.insert(hash, change); |
| 961 | |
| 962 | let node = GraphNode::new( |
| 963 | Some(hash), |
| 964 | ChangePosition::new(0), |
| 965 | ChangePosition::new(content.len() as u64), |
| 966 | ); |
| 967 | let mut buf = vec![0u8; content.len()]; |
| 968 | |
| 969 | let n = store.get_contents_ext(node, &mut buf).unwrap(); |
| 970 | |
| 971 | assert_eq!(n, content.len()); |
| 972 | assert_eq!(&buf, content); |
| 973 | } |
| 974 | |
| 975 | #[test] |
| 976 | fn test_get_contents_ext_none_hash() { |
nothing calls this directly
no test coverage detected