Auto merge of #7690 - giraffate:add_test_for_cargo_locate_project, r=alexcrichton

Add a test for `cargo locate-project`

There seems to be no test for `cargo locate-project`, so I add the simple test case for this command.
This commit is contained in:
bors 2019-12-10 17:25:27 +00:00
commit a4cc2736ee
2 changed files with 17 additions and 0 deletions

View file

@ -0,0 +1,16 @@
//! Tests for the `cargo locate-project` command.
use cargo_test_support::project;
#[cargo_test]
fn simple() {
let p = project().build();
let root_manifest_path = p.root().join("Cargo.toml");
p.cargo("locate-project")
.with_stdout(format!(
r#"{{"root":"{}"}}"#,
root_manifest_path.to_str().unwrap()
))
.run();
}

View file

@ -53,6 +53,7 @@ mod install_upgrade;
mod jobserver;
mod list_targets;
mod local_registry;
mod locate_project;
mod lockfile_compat;
mod login;
mod member_errors;