Skip to content

Commit ab0d6a7

Browse files
committed
test(add): add test to show current behaviour of cargo add when @ symbol is missing for the version
1 parent 77f54cc commit ab0d6a7

File tree

5 files changed

+59
-0
lines changed

5 files changed

+59
-0
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../add-basic.in/
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
use cargo_test_support::compare::assert_ui;
2+
use cargo_test_support::current_dir;
3+
use cargo_test_support::file;
4+
use cargo_test_support::prelude::*;
5+
use cargo_test_support::str;
6+
use cargo_test_support::Project;
7+
8+
#[cargo_test]
9+
fn case() {
10+
let project = Project::from_template(current_dir!().join("in"));
11+
let project_root = project.root();
12+
let cwd = &project_root;
13+
14+
snapbox::cmd::Command::cargo_ui()
15+
.arg("add")
16+
.arg_line("my-package=1.0.0")
17+
.current_dir(cwd)
18+
.assert()
19+
.code(101)
20+
.stdout_eq(str![""])
21+
.stderr_eq(file!["stderr.term.svg"]);
22+
23+
assert_ui().subset_matches(current_dir!().join("out"), &project_root);
24+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
[workspace]
2+
3+
[package]
4+
name = "cargo-list-test-fixture"
5+
version = "0.0.0"
6+
edition = "2015"
Lines changed: 27 additions & 0 deletions
Loading

tests/testsuite/cargo_add/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ mod locked_unchanged;
6565
mod lockfile_updated;
6666
mod manifest_path_package;
6767
mod merge_activated_features;
68+
mod missing_at_in_crate_spec;
6869
mod multiple_conflicts_with_features;
6970
mod multiple_conflicts_with_rename;
7071
mod namever;

0 commit comments

Comments
 (0)