Add tests for osx/macos alias (#407)

Co-authored-by: Niklas Mohrin <dev@niklasmohrin.de>
This commit is contained in:
Christoph Loy 2025-01-12 12:04:22 +01:00 committed by GitHub
commit 09d44110f8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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();