Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix tests for cargo.exe check command #11022

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 8 additions & 4 deletions src/tests/test_known_external.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
use std::process::Command;

use crate::tests::{fail_test, run_test, run_test_contains, TestResult};

// cargo version prints a string of the form:
Expand Down Expand Up @@ -107,22 +109,24 @@ fn known_external_misc_values() -> TestResult {
/// GitHub issue #7822
#[test]
fn known_external_subcommand_from_module() -> TestResult {
run_test_contains(
let output = Command::new("cargo").arg("check").arg("-h").output()?;
run_test(
r#"
module cargo {
export extern check []
};
use cargo;
cargo check -h
"#,
"cargo check",
String::from_utf8(output.stdout)?.trim(),
)
}

/// GitHub issue #7822
#[test]
fn known_external_aliased_subcommand_from_module() -> TestResult {
run_test_contains(
let output = Command::new("cargo").arg("check").arg("-h").output()?;
run_test(
r#"
module cargo {
export extern check []
Expand All @@ -131,6 +135,6 @@ fn known_external_aliased_subcommand_from_module() -> TestResult {
alias cc = cargo check;
cc -h
"#,
"cargo check",
String::from_utf8(output.stdout)?.trim(),
)
}