minecraft_java_rs_core/utils/
version_check.rs1#[inline]
7pub fn is_old(assets: Option<&str>) -> bool {
8 matches!(assets, Some("legacy") | Some("pre-1.6"))
9}
10
11#[cfg(test)]
12mod tests {
13 use super::*;
14
15 #[test]
16 fn recognises_legacy_strings() {
17 assert!(is_old(Some("legacy")));
18 assert!(is_old(Some("pre-1.6")));
19 }
20
21 #[test]
22 fn modern_versions_are_not_old() {
23 assert!(!is_old(Some("1.19")));
24 assert!(!is_old(Some("1")));
25 assert!(!is_old(None));
26 assert!(!is_old(Some("Legacy")));
28 }
29}