Skip to content

Commit a4cc273

Browse files
committed
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.
2 parents 774d949 + ba74297 commit a4cc273

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

tests/testsuite/locate_project.rs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
//! Tests for the `cargo locate-project` command.
2+
3+
use cargo_test_support::project;
4+
5+
#[cargo_test]
6+
fn simple() {
7+
let p = project().build();
8+
let root_manifest_path = p.root().join("Cargo.toml");
9+
10+
p.cargo("locate-project")
11+
.with_stdout(format!(
12+
r#"{{"root":"{}"}}"#,
13+
root_manifest_path.to_str().unwrap()
14+
))
15+
.run();
16+
}

tests/testsuite/main.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ mod install_upgrade;
5353
mod jobserver;
5454
mod list_targets;
5555
mod local_registry;
56+
mod locate_project;
5657
mod lockfile_compat;
5758
mod login;
5859
mod member_errors;

0 commit comments

Comments
 (0)