Skip to content

Commit 6fc8c25

Browse files
committed
Add test case for feature adding with fuzzy name #10680
1 parent 262f525 commit 6fc8c25

File tree

6 files changed

+96
-0
lines changed

6 files changed

+96
-0
lines changed
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+
your_face = { version = "99999.0.0", features = ["eyes"] }

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

Whitespace-only changes.
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
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("your_face", "99999.0.0+my-package")
12+
.feature("nose", &[])
13+
.feature("mouth", &[])
14+
.feature("eyes", &[])
15+
.feature("ears", &[])
16+
.publish();
17+
18+
let project = Project::from_template(current_dir!().join("in"));
19+
let project_root = project.root();
20+
let cwd = &project_root;
21+
22+
snapbox::cmd::Command::cargo_ui()
23+
.arg("add")
24+
.arg_line("your-face")
25+
.current_dir(cwd)
26+
.assert()
27+
.success()
28+
.stdout_matches(str![""])
29+
.stderr_matches(file!["stderr.term.svg"]);
30+
31+
assert_ui().subset_matches(current_dir!().join("out"), &project_root);
32+
}
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+
your_face = { version = "99999.0.0" }
Lines changed: 45 additions & 0 deletions
Loading

tests/testsuite/cargo_add/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ mod features;
2626
mod features_activated_over_limit;
2727
mod features_deactivated_over_limit;
2828
mod features_empty;
29+
mod features_fuzzy;
2930
mod features_multiple_occurrences;
3031
mod features_preserve;
3132
mod features_spaced_values;

0 commit comments

Comments
 (0)