Skip to content

Commit

Permalink
Add tests for osx/macos alias (#407)
Browse files Browse the repository at this point in the history
Co-authored-by: Niklas Mohrin <[email protected]>
  • Loading branch information
beatbrot and niklasmohrin authored Jan 12, 2025
1 parent b9f116d commit 09d4411
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions tests/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -652,6 +652,34 @@ fn test_multiple_platform_command_search_not_found() {
.stderr(contains("Page `windows-only` not found in cache."));
}

#[test]
fn test_macos_is_alias_for_osx() {
let testenv = TestEnv::new();
testenv.add_os_entry("osx", "maconly", "this command only exists on mac");

testenv
.command()
.args(["--platform", "macos", "maconly"])
.assert()
.success();
testenv
.command()
.args(["--platform", "osx", "maconly"])
.assert()
.success();

testenv
.command()
.args(["--platform", "macos", "--list"])
.assert()
.stdout("maconly\n");
testenv
.command()
.args(["--platform", "osx", "--list"])
.assert()
.stdout("maconly\n");
}

#[test]
fn test_common_platform_is_used_as_fallback() {
let testenv = TestEnv::new();
Expand Down

0 comments on commit 09d4411

Please sign in to comment.