Skip to content

Commit

Permalink
Fix macOS deployment target test case on Rust 1.74+ (#1861)
Browse files Browse the repository at this point in the history
  • Loading branch information
messense authored Nov 21, 2023
1 parent 638db2c commit f94e3e3
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions src/build_context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1268,25 +1268,29 @@ mod test {

#[test]
fn test_macosx_deployment_target() {
let rustc_ver = rustc_version::version().unwrap();
let rustc_ver = (rustc_ver.major, rustc_ver.minor);
let x86_64_minor = if rustc_ver >= (1, 74) { 12 } else { 7 };
let universal2_minor = if rustc_ver >= (1, 74) { 12 } else { 9 };
assert_eq!(
macosx_deployment_target(None, false).unwrap(),
((10, 7), (11, 0))
((10, x86_64_minor), (11, 0))
);
assert_eq!(
macosx_deployment_target(None, true).unwrap(),
((10, 9), (11, 0))
((10, universal2_minor), (11, 0))
);
assert_eq!(
macosx_deployment_target(Some("10.6"), false).unwrap(),
((10, 7), (11, 0))
((10, x86_64_minor), (11, 0))
);
assert_eq!(
macosx_deployment_target(Some("10.6"), true).unwrap(),
((10, 9), (11, 0))
((10, universal2_minor), (11, 0))
);
assert_eq!(
macosx_deployment_target(Some("10.9"), false).unwrap(),
((10, 9), (11, 0))
((10, universal2_minor), (11, 0))
);
assert_eq!(
macosx_deployment_target(Some("11.0.0"), false).unwrap(),
Expand Down

0 comments on commit f94e3e3

Please sign in to comment.