Skip to content

Commit

Permalink
Fix macOS deployment target test case on Rust 1.74+
Browse files Browse the repository at this point in the history
  • Loading branch information
messense committed Nov 21, 2023
1 parent 04b4b68 commit c9ec51a
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 c9ec51a

Please sign in to comment.