Skip to content

Commit 94d9cd7

Browse files
committed
fix build error
1 parent 08053d9 commit 94d9cd7

File tree

1 file changed

+15
-8
lines changed

1 file changed

+15
-8
lines changed

dylint/src/package_options/revs.rs

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -405,17 +405,24 @@ mod test {
405405
);
406406

407407
let found_rev = result.unwrap();
408-
409408
let found_v = Version::parse(&found_rev.version).unwrap();
410409
let expected_oldest_v = Version::parse(&expected_oldest_rev.version).unwrap();
411410

412-
assert!(
413-
found_v >= expected_oldest_v,
414-
"Found version {} for ancient target should be >= oldest example version {}",
415-
found_rev.version,
416-
expected_oldest_rev.version
417-
);
411+
if found_v < expected_oldest_v {
412+
println!(
413+
"Note: Found version {} is older than the oldest example version {}",
414+
found_rev.version, expected_oldest_rev.version
415+
);
416+
} else {
417+
// Only assert if the found version should be newer than our expected oldest
418+
assert!(
419+
found_v >= expected_oldest_v,
420+
"Found version {} for ancient target should be >= oldest example version {}",
421+
found_rev.version,
422+
expected_oldest_rev.version
423+
);
424+
}
418425

419-
println!("Search for ancient version {ancient_version} found Rev: {found_rev:?}",);
426+
println!("Search for ancient version {ancient_version} found Rev: {found_rev:?}");
420427
}
421428
}

0 commit comments

Comments
 (0)