##// END OF EJS Templates
rust: adapted hg-core tests for iteration over Result...
Georges Racinet -
r40965:43ca24b7 default
parent child Browse files
Show More
@@ -173,6 +173,7 b' mod tests {'
173 173 ) -> Vec<Revision> {
174 174 AncestorsIterator::new(graph, initrevs, stoprev, inclusive)
175 175 .unwrap()
176 .map(|res| res.unwrap())
176 177 .collect()
177 178 }
178 179
@@ -218,12 +219,12 b' mod tests {'
218 219 fn test_contains() {
219 220 let mut lazy =
220 221 AncestorsIterator::new(Stub, vec![10, 1], 0, true).unwrap();
221 assert!(lazy.contains(1));
222 assert!(!lazy.contains(3));
222 assert!(lazy.contains(1).unwrap());
223 assert!(!lazy.contains(3).unwrap());
223 224
224 225 let mut lazy =
225 226 AncestorsIterator::new(Stub, vec![0], 0, false).unwrap();
226 assert!(!lazy.contains(NULL_REVISION));
227 assert!(!lazy.contains(NULL_REVISION).unwrap());
227 228 }
228 229
229 230 /// A corrupted Graph, supporting error handling tests
@@ -255,7 +256,6 b' mod tests {'
255 256 // inclusive=false looks up initrev's parents right away
256 257 let mut iter =
257 258 AncestorsIterator::new(Corrupted, vec![1], 0, false).unwrap();
258 assert_eq!(iter.next(), Some(0));
259 assert_eq!(iter.next(), None);
259 assert_eq!(iter.next(), Some(Err(GraphError::ParentOutOfRange(0))));
260 260 }
261 261 }
General Comments 0
You need to be logged in to leave comments. Login now