Clarify update check when local is newer
ci / test (push) Waiting to run
ci / fuzz-smoke (push) Waiting to run
ci / windows-client (push) Waiting to run
ci / package-release (linux-x86_64, ubuntu-latest) (push) Waiting to run
ci / package-release (macos-aarch64, macos-14) (push) Waiting to run
ci / package-release (macos-x86_64, macos-13) (push) Waiting to run
ci / package-release (windows-x86_64, windows-latest) (push) Waiting to run
ci / publish-gitea-release (push) Blocked by required conditions
ci / remote-bench (push) Waiting to run

This commit is contained in:
DuProcess
2026-07-12 21:25:42 -04:00
parent d883e1cdb2
commit c9332f707d
3 changed files with 11 additions and 4 deletions
+9 -2
View File
@@ -4120,7 +4120,7 @@ fn update_version_status(local: &str, latest: &str) -> &'static str {
match compare_dotted_versions(latest, local) {
std::cmp::Ordering::Equal => "current",
std::cmp::Ordering::Greater => "update available",
std::cmp::Ordering::Less => "different",
std::cmp::Ordering::Less => "local newer than latest release",
}
}
@@ -11222,7 +11222,14 @@ mod tests {
fn update_version_status_compares_numeric_parts() {
assert_eq!(update_version_status("0.1.5", "0.1.5"), "current");
assert_eq!(update_version_status("0.1.9", "0.1.10"), "update available");
assert_eq!(update_version_status("1.0.0", "0.9.9"), "different");
assert_eq!(
update_version_status("1.0.0", "0.9.9"),
"local newer than latest release"
);
assert_eq!(
update_version_status("1.0.0-rc40", "1.0.0-rc37"),
"local newer than latest release"
);
}
#[test]