From ba74297c20f0048082f7ad888a8bc80358686ce5 Mon Sep 17 00:00:00 2001 From: Takayuki Nakata Date: Tue, 10 Dec 2019 09:18:12 +0900 Subject: [PATCH] Add a test for `cargo locate-project` --- tests/testsuite/locate_project.rs | 16 ++++++++++++++++ tests/testsuite/main.rs | 1 + 2 files changed, 17 insertions(+) create mode 100644 tests/testsuite/locate_project.rs diff --git a/tests/testsuite/locate_project.rs b/tests/testsuite/locate_project.rs new file mode 100644 index 00000000000..17712a69c24 --- /dev/null +++ b/tests/testsuite/locate_project.rs @@ -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(); +} diff --git a/tests/testsuite/main.rs b/tests/testsuite/main.rs index 9c22bbdc29d..6b766e38dbb 100644 --- a/tests/testsuite/main.rs +++ b/tests/testsuite/main.rs @@ -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;