Skip to content

Commit e008a39

Browse files
committed
test(add): Check normalization with a yanked package
1 parent 9bdc777 commit e008a39

File tree

5 files changed

+72
-0
lines changed

5 files changed

+72
-0
lines changed

tests/testsuite/cargo_add/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ mod normalize_name_path;
7575
mod normalize_name_path_existing;
7676
mod normalize_name_registry;
7777
mod normalize_name_registry_existing;
78+
mod normalize_name_registry_yanked;
7879
mod normalize_name_workspace_dep;
7980
mod offline_empty_cache;
8081
mod optional;
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+
.failure()
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: 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: 33 additions & 0 deletions
Loading

0 commit comments

Comments
 (0)