|
@ -136,14 +136,20 @@ mod test { |
|
|
let start = Instant::now();
|
|
|
let start = Instant::now();
|
|
|
assert!(run(checkout.target_reached()).unwrap());
|
|
|
assert!(run(checkout.target_reached()).unwrap());
|
|
|
let end = Instant::now();
|
|
|
let end = Instant::now();
|
|
|
|
|
|
let mut args = c.args.into_inner();
|
|
|
|
|
|
let first_two_args = &mut args[0..2];
|
|
|
|
|
|
first_two_args.sort_unstable();
|
|
|
assert_eq!(
|
|
|
assert_eq!(
|
|
|
c.args.into_inner(),
|
|
|
|
|
|
|
|
|
first_two_args,
|
|
|
[
|
|
|
[
|
|
|
["-C", "target", "fetch", "source", "branch"],
|
|
|
["-C", "target", "fetch", "source", "branch"],
|
|
|
["-C", "target", "rev-list", "-1", "HEAD"],
|
|
|
["-C", "target", "rev-list", "-1", "HEAD"],
|
|
|
["-C", "target", "rev-list", "-1", "FETCH_HEAD"]
|
|
|
|
|
|
]
|
|
|
]
|
|
|
);
|
|
|
);
|
|
|
|
|
|
drop(first_two_args);
|
|
|
|
|
|
assert_eq!(args[2],
|
|
|
|
|
|
["-C", "target", "rev-list", "-1", "FETCH_HEAD"]);
|
|
|
|
|
|
|
|
|
assert!((end - start).as_millis() >= 100);
|
|
|
assert!((end - start).as_millis() >= 100);
|
|
|
assert!((end - start).as_millis() < 150);
|
|
|
assert!((end - start).as_millis() < 150);
|
|
|
}
|
|
|
}
|
|
|