]> git.proxmox.com Git - cargo.git/blob - tests/testsuite/cargo_add/invalid_path_name/mod.rs
Update upstream source from tag 'upstream/0.66.0'
[cargo.git] / tests / testsuite / cargo_add / invalid_path_name / mod.rs
1 use cargo_test_support::compare::assert_ui;
2 use cargo_test_support::prelude::*;
3 use cargo_test_support::Project;
4
5 use crate::cargo_add::init_registry;
6 use cargo_test_support::curr_dir;
7
8 #[cargo_test]
9 fn invalid_path_name() {
10 init_registry();
11 let project = Project::from_template(curr_dir!().join("in"));
12 let project_root = project.root();
13 let cwd = project_root.join("primary");
14
15 snapbox::cmd::Command::cargo_ui()
16 .arg("add")
17 .arg_line("not-at-path --path ../dependency")
18 .current_dir(&cwd)
19 .assert()
20 .code(101)
21 .stdout_matches_path(curr_dir!().join("stdout.log"))
22 .stderr_matches_path(curr_dir!().join("stderr.log"));
23
24 assert_ui().subset_matches(curr_dir!().join("out"), &project_root);
25 }