Skip to content

Commit b27ffdd

Browse files
committed
Add test to ensure this is fixed
1 parent 6657d70 commit b27ffdd

File tree

8 files changed

+90
-0
lines changed

8 files changed

+90
-0
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
[source.crates-io]
2+
replace-with = "vendored-sources"
3+
4+
[source.vendored-sources]
5+
directory = "./vendor"
6+
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
2+
[workspace]
3+
4+
[package]
5+
name = "cargo-list-test-fixture"
6+
version = "0.0.0"

tests/testsuite/cargo_add/add_no_vendored_packages_with_vendor/in/src/lib.rs

Whitespace-only changes.
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
use cargo_test_support::ProjectBuilder;
2+
use cargo_test_support::compare::assert_ui;
3+
use cargo_test_support::paths;
4+
use cargo_test_support::prelude::*;
5+
6+
use cargo_test_support::curr_dir;
7+
8+
#[cargo_test]
9+
fn case() {
10+
cargo_test_support::registry::alt_init();
11+
cargo_test_support::registry::Package::new("linked-hash-map", "0.5.4")
12+
.feature("clippy", &[])
13+
.feature("heapsize", &[])
14+
.feature("heapsize_impl", &[])
15+
.feature("nightly", &[])
16+
.feature("serde", &[])
17+
.feature("serde_impl", &[])
18+
.feature("serde_test", &[])
19+
.alternative(true)
20+
.publish();
21+
22+
let project = ProjectBuilder::new(paths::root().join("in"))
23+
.file(".cargo/config",
24+
r#"
25+
[source.crates-io]
26+
replace-with = "vendored-sources"
27+
28+
[source.vendored-sources]
29+
directory = "./vendor"
30+
"#,
31+
)
32+
.file("src/lib.rs", "")
33+
.file(
34+
"Cargo.toml",
35+
r#"
36+
[workspace]
37+
38+
[package]
39+
name = "cargo-list-test-fixture"
40+
version = "0.0.0"
41+
"#,
42+
)
43+
.build();
44+
let project_root = project.root();
45+
let cwd = &project_root;
46+
47+
snapbox::cmd::Command::cargo_ui()
48+
.arg("add")
49+
.arg_line("linked_hash_map --registry alternative")
50+
.current_dir(cwd)
51+
.assert()
52+
.success()
53+
.stdout_matches_path(curr_dir!().join("stdout.log"))
54+
.stderr_matches_path(curr_dir!().join("stderr.log"));
55+
56+
assert_ui().subset_matches(curr_dir!().join("out"), &project_root);
57+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
2+
[workspace]
3+
4+
[package]
5+
name = "cargo-list-test-fixture"
6+
version = "0.0.0"
7+
8+
[dependencies]
9+
linked-hash-map = { version = "0.5.4", registry = "alternative" }
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
Updating `alternative` index
2+
warning: translating `linked_hash_map` to `linked-hash-map`
3+
Adding linked-hash-map v0.5.4 to dependencies.
4+
Features:
5+
- clippy
6+
- heapsize
7+
- heapsize_impl
8+
- nightly
9+
- serde
10+
- serde_impl
11+
- serde_test

tests/testsuite/cargo_add/add_no_vendored_packages_with_vendor/stdout.log

Whitespace-only changes.

tests/testsuite/cargo_add/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
mod add_basic;
22
mod add_multiple;
3+
mod add_no_vendored_packages_with_vendor;
34
mod add_normalized_name_external;
45
mod add_toolchain;
56
mod build;

0 commit comments

Comments
 (0)