From 09d44110f8be8fa175172e564d2a7145f59ef3de Mon Sep 17 00:00:00 2001 From: Christoph Loy Date: Sun, 12 Jan 2025 12:04:22 +0100 Subject: [PATCH] Add tests for osx/macos alias (#407) Co-authored-by: Niklas Mohrin --- tests/lib.rs | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/tests/lib.rs b/tests/lib.rs index feb82a0..63edca6 100644 --- a/tests/lib.rs +++ b/tests/lib.rs @@ -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();