Skip to content

Commit 737a5e8

Browse files
committed
test(add): Verify yanked behavior
1 parent e008a39 commit 737a5e8

File tree

5 files changed

+73
-0
lines changed

5 files changed

+73
-0
lines changed

tests/testsuite/cargo_add/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,3 +150,4 @@ mod vers;
150150
mod workspace_name;
151151
mod workspace_path;
152152
mod workspace_path_dev;
153+
mod yanked;

tests/testsuite/cargo_add/yanked/in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../add-basic.in
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
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+
cargo_test_support::registry::init();
11+
cargo_test_support::registry::Package::new("linked-hash-map", "0.5.0").publish();
12+
cargo_test_support::registry::Package::new("linked-hash-map", "0.5.4").publish();
13+
cargo_test_support::registry::Package::new("linked-hash-map", "0.6.0")
14+
.yanked(true)
15+
.publish();
16+
17+
let project = Project::from_template(current_dir!().join("in"));
18+
let project_root = project.root();
19+
let cwd = &project_root;
20+
21+
snapbox::cmd::Command::cargo_ui()
22+
.arg("add")
23+
.arg_line("linked-hash-map")
24+
.current_dir(cwd)
25+
.assert()
26+
.success()
27+
.stdout_eq(str![""])
28+
.stderr_eq(file!["stderr.term.svg"]);
29+
30+
assert_ui().subset_matches(current_dir!().join("out"), &project_root);
31+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
[workspace]
2+
3+
[package]
4+
name = "cargo-list-test-fixture"
5+
version = "0.0.0"
6+
edition = "2015"
7+
8+
[dependencies]
9+
linked-hash-map = "0.5.4"
Lines changed: 31 additions & 0 deletions
Loading

0 commit comments

Comments
 (0)