Skip to content

Commit

Permalink
Add test case for feature adding with fuzzy name rust-lang#10680
Browse files Browse the repository at this point in the history
  • Loading branch information
dohse committed Apr 17, 2024
1 parent 9b201d7 commit 39c1d77
Show file tree
Hide file tree
Showing 6 changed files with 94 additions and 0 deletions.
9 changes: 9 additions & 0 deletions tests/testsuite/cargo_add/features_fuzzy/in/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[workspace]

[package]
name = "cargo-list-test-fixture"
version = "0.0.0"
edition = "2015"

[dependencies]
your_face = { version = "99999.0.0", features = ["eyes"] }
Empty file.
33 changes: 33 additions & 0 deletions tests/testsuite/cargo_add/features_fuzzy/mod.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
use cargo_test_support::compare::assert_ui;
use cargo_test_support::current_dir;
use cargo_test_support::file;
use cargo_test_support::prelude::*;
use cargo_test_support::str;
use cargo_test_support::Project;

#[cargo_test]
#[ignore]
fn case() {
cargo_test_support::registry::init();
cargo_test_support::registry::Package::new("your_face", "99999.0.0+my-package")
.feature("nose", &[])
.feature("mouth", &[])
.feature("eyes", &[])
.feature("ears", &[])
.publish();

let project = Project::from_template(current_dir!().join("in"));
let project_root = project.root();
let cwd = &project_root;

snapbox::cmd::Command::cargo_ui()
.arg("add")
.arg_line("your_face")
.current_dir(cwd)
.assert()
.success()
.stdout_matches(str![""])
.stderr_matches(file!["stderr.term.svg"]);

assert_ui().subset_matches(current_dir!().join("out"), &project_root);
}
9 changes: 9 additions & 0 deletions tests/testsuite/cargo_add/features_fuzzy/out/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[workspace]

[package]
name = "cargo-list-test-fixture"
version = "0.0.0"
edition = "2015"

[dependencies]
your_face = { version = "99999.0.0", features = ["eyes"] }
42 changes: 42 additions & 0 deletions tests/testsuite/cargo_add/features_fuzzy/stderr.term.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions tests/testsuite/cargo_add/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ mod features;
mod features_activated_over_limit;
mod features_deactivated_over_limit;
mod features_empty;
mod features_fuzzy;
mod features_multiple_occurrences;
mod features_preserve;
mod features_spaced_values;
Expand Down

0 comments on commit 39c1d77

Please sign in to comment.