diff --git a/Cargo.lock b/Cargo.lock index 08e1d743ba..cc2cfc4fb3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -207,6 +207,8 @@ version = "0.8.0" dependencies = [ "anyhow", "cargo", + "cargo-test-macro", + "cargo-test-support", "clap", "concolor-control", "crates-index", @@ -222,9 +224,9 @@ dependencies = [ "serde", "serde_derive", "serde_json", + "snapbox", "termcolor", "toml_edit", - "trycmd", "ureq", "url", ] @@ -279,6 +281,33 @@ dependencies = [ "serde", ] +[[package]] +name = "cargo-test-macro" +version = "0.1.0" +source = "git+https://github.com/rust-lang/cargo#c5cdd25c14ca7bd3f1691ed59535adb4f6b2c8df" + +[[package]] +name = "cargo-test-support" +version = "0.1.0" +source = "git+https://github.com/rust-lang/cargo#c5cdd25c14ca7bd3f1691ed59535adb4f6b2c8df" +dependencies = [ + "anyhow", + "cargo-test-macro", + "cargo-util", + "filetime", + "flate2", + "git2", + "glob", + "itertools", + "lazy_static", + "remove_dir_all", + "serde_json", + "tar", + "termcolor", + "toml_edit", + "url", +] + [[package]] name = "cargo-util" version = "0.1.2" @@ -1602,9 +1631,9 @@ dependencies = [ [[package]] name = "snapbox" -version = "0.2.1" +version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39245697032574df764f27e9736fc318f52c1665be3672f791967a06ca84e4f6" +checksum = "85460b140f9f7c9b8233566c566ad5dc225d61ac8a228cbd13823ebb08622743" dependencies = [ "concolor", "content_inspector", @@ -1621,9 +1650,9 @@ dependencies = [ [[package]] name = "snapbox-macros" -version = "0.2.0" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0610ac343332c8f59b7b97a6b7c28bd7dd8cd4e82764d78cc8da98ecd3f7d48" +checksum = "c01dea7e04cbb27ef4c86e9922184608185f7cd95c1763bc30d727cda4a5e930" [[package]] name = "socket2" diff --git a/crates/cargo-add/Cargo.toml b/crates/cargo-add/Cargo.toml index 51f361716a..94926a09c8 100644 --- a/crates/cargo-add/Cargo.toml +++ b/crates/cargo-add/Cargo.toml @@ -68,7 +68,10 @@ native-tls = "^0.2" ureq = { version = "2.4.0", default-features = false, features = ["native-tls", "json", "socks", "socks-proxy"] } [dev-dependencies] -trycmd = "0.13.1" +snapbox = { version = "0.2.8", features = ["diff", "path"] } +cargo-test-macro.git = "https://github.com/rust-lang/cargo" +cargo-test-support.git = "https://github.com/rust-lang/cargo" +url = "2.2.2" [features] default = [ diff --git a/crates/cargo-add/tests/cargo-add.rs b/crates/cargo-add/tests/cargo-add.rs index cdd6812b06..0c5b259b94 100644 --- a/crates/cargo-add/tests/cargo-add.rs +++ b/crates/cargo-add/tests/cargo-add.rs @@ -1,12 +1,1776 @@ -#[test] -fn cli_tests() { - let t = trycmd::TestCases::new(); - t.case("tests/cmd/add/*.toml"); - #[cfg(not(feature = "test-external-apis"))] - { - t.skip("tests/cmd/add/invalid_git_external.toml"); - t.skip("tests/cmd/add/invalid_name_external.toml"); - t.skip("tests/cmd/add/add_normalized_name_external.toml"); - t.skip("tests/cmd/add/git_external.toml"); +#![warn(rust_2018_idioms)] +#![allow(clippy::all)] +#![warn(clippy::needless_borrow)] +#![warn(clippy::redundant_clone)] + +#[macro_use] +extern crate cargo_test_macro; + +pub fn cargo_exe() -> &'static std::path::Path { + snapbox::cmd::cargo_bin!("cargo-add") +} + +pub fn cargo_command() -> snapbox::cmd::Command { + let mut cmd = snapbox::cmd::Command::new(cargo_exe()).with_assert(assert()); + + // In general just clear out all cargo-specific configuration already in the + // environment. Our tests all assume a "default configuration" unless + // specified otherwise. + for (k, _v) in std::env::vars() { + if k.starts_with("CARGO_") { + cmd = cmd.env_remove(&k); + } } + + cmd = cmd + .env("HOME", cargo_test_support::paths::home()) + .env( + "CARGO_HOME", + cargo_test_support::paths::home().join(".cargo"), + ) + .env("__CARGO_TEST_ROOT", cargo_test_support::paths::root()) + // Force Cargo to think it's on the stable channel for all tests, this + // should hopefully not surprise us as we add cargo features over time and + // cargo rides the trains. + .env("__CARGO_TEST_CHANNEL_OVERRIDE_DO_NOT_USE_THIS", "stable") + // For now disable incremental by default as support hasn't ridden to the + // stable channel yet. Once incremental support hits the stable compiler we + // can switch this to one and then fix the tests. + .env("CARGO_INCREMENTAL", "0") + .env_remove("__CARGO_DEFAULT_LIB_METADATA") + .env_remove("RUSTC") + .env_remove("RUSTDOC") + .env_remove("RUSTC_WRAPPER") + .env_remove("RUSTFLAGS") + .env_remove("RUSTDOCFLAGS") + .env_remove("XDG_CONFIG_HOME") // see #2345 + .env("GIT_CONFIG_NOSYSTEM", "1") // keep trying to sandbox ourselves + .env_remove("EMAIL") + .env_remove("USER") // not set on some rust-lang docker images + .env_remove("MFLAGS") + .env_remove("MAKEFLAGS") + .env_remove("GIT_AUTHOR_NAME") + .env_remove("GIT_AUTHOR_EMAIL") + .env_remove("GIT_COMMITTER_NAME") + .env_remove("GIT_COMMITTER_EMAIL") + .env_remove("MSYSTEM"); // assume cmd.exe everywhere on windows + + cmd +} + +pub fn project_from_template(template_path: impl AsRef) -> std::path::PathBuf { + let root = cargo_test_support::paths::root(); + let project_root = root.join("case"); + snapbox::path::copy_template(template_path.as_ref(), &project_root).unwrap(); + project_root +} + +pub fn assert() -> snapbox::Assert { + let root = cargo_test_support::paths::root(); + // Use `from_file_path` instead of `from_dir_path` so the trailing slash is + // put in the users output, rather than hidden in the variable + let root_url = url::Url::from_file_path(&root).unwrap().to_string(); + let root = root.display().to_string(); + + let mut subs = snapbox::Substitutions::new(); + subs.extend([ + ( + "[EXE]", + std::borrow::Cow::Borrowed(std::env::consts::EXE_SUFFIX), + ), + ("[ROOT]", std::borrow::Cow::Owned(root)), + ("[ROOTURL]", std::borrow::Cow::Owned(root_url)), + ]) + .unwrap(); + snapbox::Assert::new() + .action_env(snapbox::DEFAULT_ACTION_ENV) + .substitutions(subs) +} + +fn init_registry() { + cargo_test_support::registry::init(); + add_registry_packages(false); +} + +fn init_alt_registry() { + cargo_test_support::registry::alt_init(); + add_registry_packages(true); +} + +fn add_registry_packages(alt: bool) { + for name in [ + "my-package", + "my-package1", + "my-package2", + "my-dev-package1", + "my-dev-package2", + "my-build-package1", + "my-build-package2", + "toml", + "versioned-package", + "cargo-list-test-fixture-dependency", + "unrelateed-crate", + ] { + cargo_test_support::registry::Package::new(name, "99999.0.0+my-package") + .alternative(alt) + .publish(); + cargo_test_support::registry::Package::new(name, "99999.0.0-alpha.1+my-package") + .alternative(alt) + .publish(); + } + + cargo_test_support::registry::Package::new("test_breaking", "0.2.0") + .alternative(alt) + .publish(); + cargo_test_support::registry::Package::new("test_nonbreaking", "0.1.1") + .alternative(alt) + .publish(); + + // Normalization + cargo_test_support::registry::Package::new("linked-hash-map", "0.5.4") + .alternative(alt) + .feature("clippy", &[]) + .feature("heapsize", &[]) + .feature("heapsize_impl", &[]) + .feature("nightly", &[]) + .feature("serde", &[]) + .feature("serde_impl", &[]) + .feature("serde_test", &[]) + .publish(); + cargo_test_support::registry::Package::new("inflector", "0.11.4") + .alternative(alt) + .feature("default", &["heavyweight", "lazy_static", "regex"]) + .feature("heavyweight", &[]) + .feature("lazy_static", &[]) + .feature("regex", &[]) + .feature("unstable", &[]) + .publish(); + + cargo_test_support::registry::Package::new("your-face", "99999.0.0+my-package") + .alternative(alt) + .feature("nose", &[]) + .feature("mouth", &[]) + .feature("eyes", &[]) + .feature("ears", &[]) + .publish(); +} + +#[cargo_test] +fn add_basic() { + init_registry(); + let project_root = project_from_template("tests/snapshots/add/add_basic.in"); + let cwd = &project_root; + + cargo_command() + .arg("add") + .args(["my-package"]) + .current_dir(cwd) + .assert() + .success() + .stdout_matches_path("tests/snapshots/add/add_basic.stdout") + .stderr_matches_path("tests/snapshots/add/add_basic.stderr"); + + assert().subset_matches("tests/snapshots/add/add_basic.out", &project_root); +} + +#[cargo_test] +fn add_multiple() { + init_registry(); + let project_root = project_from_template("tests/snapshots/add/add_multiple.in"); + let cwd = &project_root; + + cargo_command() + .arg("add") + .args(["my-package1", "my-package2"]) + .current_dir(cwd) + .assert() + .success() + .stdout_matches_path("tests/snapshots/add/add_multiple.stdout") + .stderr_matches_path("tests/snapshots/add/add_multiple.stderr"); + + assert().subset_matches("tests/snapshots/add/add_multiple.out", &project_root); +} + +#[cargo_test] +fn add_normalized_name_external() { + init_registry(); + let project_root = project_from_template("tests/snapshots/add/add_normalized_name_external.in"); + let cwd = &project_root; + + cargo_command() + .arg("add") + .args(["linked_hash_map", "Inflector"]) + .current_dir(cwd) + .assert() + .success() + .stdout_matches_path("tests/snapshots/add/add_normalized_name_external.stdout") + .stderr_matches_path("tests/snapshots/add/add_normalized_name_external.stderr"); + + assert().subset_matches( + "tests/snapshots/add/add_normalized_name_external.out", + &project_root, + ); +} + +#[cargo_test] +fn build() { + init_registry(); + let project_root = project_from_template("tests/snapshots/add/build.in"); + let cwd = &project_root; + + cargo_command() + .arg("add") + .args(["--build", "my-build-package1", "my-build-package2"]) + .current_dir(cwd) + .assert() + .success() + .stdout_matches_path("tests/snapshots/add/build.stdout") + .stderr_matches_path("tests/snapshots/add/build.stderr"); + + assert().subset_matches("tests/snapshots/add/build.out", &project_root); +} + +#[cargo_test] +fn build_prefer_existing_version() { + init_alt_registry(); + let project_root = + project_from_template("tests/snapshots/add/build_prefer_existing_version.in"); + let cwd = &project_root; + + cargo_command() + .arg("add") + .args(["cargo-list-test-fixture-dependency", "--build"]) + .current_dir(cwd) + .assert() + .success() + .stdout_matches_path("tests/snapshots/add/build_prefer_existing_version.stdout") + .stderr_matches_path("tests/snapshots/add/build_prefer_existing_version.stderr"); + + assert().subset_matches( + "tests/snapshots/add/build_prefer_existing_version.out", + &project_root, + ); +} + +#[cargo_test] +fn default_features() { + init_registry(); + let project_root = project_from_template("tests/snapshots/add/default_features.in"); + let cwd = &project_root; + + cargo_command() + .arg("add") + .args(["my-package1", "my-package2@0.4.1", "--default-features"]) + .current_dir(cwd) + .assert() + .success() + .stdout_matches_path("tests/snapshots/add/default_features.stdout") + .stderr_matches_path("tests/snapshots/add/default_features.stderr"); + + assert().subset_matches("tests/snapshots/add/default_features.out", &project_root); +} + +#[cargo_test] +fn dev() { + init_registry(); + let project_root = project_from_template("tests/snapshots/add/dev.in"); + let cwd = &project_root; + + cargo_command() + .arg("add") + .args(["--dev", "my-dev-package1", "my-dev-package2"]) + .current_dir(cwd) + .assert() + .success() + .stdout_matches_path("tests/snapshots/add/dev.stdout") + .stderr_matches_path("tests/snapshots/add/dev.stderr"); + + assert().subset_matches("tests/snapshots/add/dev.out", &project_root); +} + +#[cargo_test] +fn dev_build_conflict() { + init_registry(); + let project_root = project_from_template("tests/snapshots/add/dev_build_conflict.in"); + let cwd = &project_root; + + cargo_command() + .arg("add") + .args(["my-package", "--dev", "--build"]) + .current_dir(cwd) + .assert() + .code(2) + .stdout_matches_path("tests/snapshots/add/dev_build_conflict.stdout") + .stderr_matches_path("tests/snapshots/add/dev_build_conflict.stderr"); + + assert().subset_matches("tests/snapshots/add/dev_build_conflict.out", &project_root); +} + +#[cargo_test] +fn dev_prefer_existing_version() { + init_alt_registry(); + let project_root = project_from_template("tests/snapshots/add/dev_prefer_existing_version.in"); + let cwd = &project_root; + + cargo_command() + .arg("add") + .args(["cargo-list-test-fixture-dependency", "--dev"]) + .current_dir(cwd) + .assert() + .success() + .stdout_matches_path("tests/snapshots/add/dev_prefer_existing_version.stdout") + .stderr_matches_path("tests/snapshots/add/dev_prefer_existing_version.stderr"); + + assert().subset_matches( + "tests/snapshots/add/dev_prefer_existing_version.out", + &project_root, + ); +} + +#[cargo_test] +fn dry_run() { + init_registry(); + let project_root = project_from_template("tests/snapshots/add/dry_run.in"); + let cwd = &project_root; + + cargo_command() + .arg("add") + .args(["my-package", "--dry-run"]) + .current_dir(cwd) + .assert() + .success() + .stdout_matches_path("tests/snapshots/add/dry_run.stdout") + .stderr_matches_path("tests/snapshots/add/dry_run.stderr"); + + assert().subset_matches("tests/snapshots/add/dry_run.out", &project_root); +} + +#[cargo_test] +fn features() { + init_registry(); + let project_root = project_from_template("tests/snapshots/add/features.in"); + let cwd = &project_root; + + cargo_command() + .arg("add") + .args(["your-face", "--features", "eyes"]) + .current_dir(cwd) + .assert() + .success() + .stdout_matches_path("tests/snapshots/add/features.stdout") + .stderr_matches_path("tests/snapshots/add/features.stderr"); + + assert().subset_matches("tests/snapshots/add/features.out", &project_root); +} + +#[cargo_test] +fn features_empty() { + init_registry(); + let project_root = project_from_template("tests/snapshots/add/features_empty.in"); + let cwd = &project_root; + + cargo_command() + .arg("add") + .args(["your-face", "--features", ""]) + .current_dir(cwd) + .assert() + .success() + .stdout_matches_path("tests/snapshots/add/features_empty.stdout") + .stderr_matches_path("tests/snapshots/add/features_empty.stderr"); + + assert().subset_matches("tests/snapshots/add/features_empty.out", &project_root); +} + +#[cargo_test] +fn features_multiple_occurrences() { + init_registry(); + let project_root = + project_from_template("tests/snapshots/add/features_multiple_occurrences.in"); + let cwd = &project_root; + + cargo_command() + .arg("add") + .args(["your-face", "--features", "eyes", "--features", "nose"]) + .current_dir(cwd) + .assert() + .success() + .stdout_matches_path("tests/snapshots/add/features_multiple_occurrences.stdout") + .stderr_matches_path("tests/snapshots/add/features_multiple_occurrences.stderr"); + + assert().subset_matches( + "tests/snapshots/add/features_multiple_occurrences.out", + &project_root, + ); +} + +#[cargo_test] +fn features_preserve() { + init_registry(); + let project_root = project_from_template("tests/snapshots/add/features_preserve.in"); + let cwd = &project_root; + + cargo_command() + .arg("add") + .args(["your-face"]) + .current_dir(cwd) + .assert() + .success() + .stdout_matches_path("tests/snapshots/add/features_preserve.stdout") + .stderr_matches_path("tests/snapshots/add/features_preserve.stderr"); + + assert().subset_matches("tests/snapshots/add/features_preserve.out", &project_root); +} + +#[cargo_test] +fn features_spaced_values() { + init_registry(); + let project_root = project_from_template("tests/snapshots/add/features_spaced_values.in"); + let cwd = &project_root; + + cargo_command() + .arg("add") + .args(["your-face", "--features", "eyes nose"]) + .current_dir(cwd) + .assert() + .success() + .stdout_matches_path("tests/snapshots/add/features_spaced_values.stdout") + .stderr_matches_path("tests/snapshots/add/features_spaced_values.stderr"); + + assert().subset_matches( + "tests/snapshots/add/features_spaced_values.out", + &project_root, + ); +} + +#[cargo_test] +fn features_unknown() { + init_registry(); + let project_root = project_from_template("tests/snapshots/add/features_unknown.in"); + let cwd = &project_root; + + cargo_command() + .arg("add") + .args(["your-face", "--features", "noze"]) + .current_dir(cwd) + .assert() + .success() + .stdout_matches_path("tests/snapshots/add/features_unknown.stdout") + .stderr_matches_path("tests/snapshots/add/features_unknown.stderr"); + + assert().subset_matches("tests/snapshots/add/features_unknown.out", &project_root); +} + +#[cargo_test] +fn git() { + init_registry(); + let project_root = project_from_template("tests/snapshots/add/git.in"); + let cwd = &project_root; + + cargo_command() + .arg("add") + .args([ + "git-package", + "--git", + "http://localhost/git-package.git", + "-Zgit", + ]) + .current_dir(cwd) + .assert() + .success() + .stdout_matches_path("tests/snapshots/add/git.stdout") + .stderr_matches_path("tests/snapshots/add/git.stderr"); + + assert().subset_matches("tests/snapshots/add/git.out", &project_root); +} + +#[cargo_test] +fn git_branch() { + init_registry(); + let project_root = project_from_template("tests/snapshots/add/git_branch.in"); + let cwd = &project_root; + + cargo_command() + .arg("add") + .args([ + "git-package", + "--git", + "http://localhost/git-package.git", + "--branch", + "main", + "-Zgit", + ]) + .current_dir(cwd) + .assert() + .success() + .stdout_matches_path("tests/snapshots/add/git_branch.stdout") + .stderr_matches_path("tests/snapshots/add/git_branch.stderr"); + + assert().subset_matches("tests/snapshots/add/git_branch.out", &project_root); +} + +#[cargo_test] +fn git_conflicts_namever() { + init_registry(); + let project_root = project_from_template("tests/snapshots/add/git_conflicts_namever.in"); + let cwd = &project_root; + + cargo_command() + .arg("add") + .args([ + "my-package@0.4.3", + "--git", + "https://github.com/dcjanus/invalid", + "-Zgit", + ]) + .current_dir(cwd) + .assert() + .code(1) + .stdout_matches_path("tests/snapshots/add/git_conflicts_namever.stdout") + .stderr_matches_path("tests/snapshots/add/git_conflicts_namever.stderr"); + + assert().subset_matches( + "tests/snapshots/add/git_conflicts_namever.out", + &project_root, + ); +} + +#[cargo_test] +fn git_conflicts_registry() { + init_registry(); + let project_root = project_from_template("tests/snapshots/add/git_conflicts_registry.in"); + let cwd = &project_root; + + cargo_command() + .arg("add") + .args([ + "my-package", + "--git", + "https://github.com/dcjanus/invalid", + "--registry", + "alternative", + "-Zgit", + ]) + .current_dir(cwd) + .assert() + .code(2) + .stdout_matches_path("tests/snapshots/add/git_conflicts_registry.stdout") + .stderr_matches_path("tests/snapshots/add/git_conflicts_registry.stderr"); + + assert().subset_matches( + "tests/snapshots/add/git_conflicts_registry.out", + &project_root, + ); +} + +#[cargo_test] +fn git_dev() { + init_registry(); + let project_root = project_from_template("tests/snapshots/add/git_dev.in"); + let cwd = &project_root; + + cargo_command() + .arg("add") + .args([ + "git-package", + "--git", + "http://localhost/git-package.git", + "--dev", + "-Zgit", + ]) + .current_dir(cwd) + .assert() + .success() + .stdout_matches_path("tests/snapshots/add/git_dev.stdout") + .stderr_matches_path("tests/snapshots/add/git_dev.stderr"); + + assert().subset_matches("tests/snapshots/add/git_dev.out", &project_root); +} + +#[cargo_test] +#[cfg(feature = "test-external-apis")] +fn git_external() { + init_registry(); + let project_root = project_from_template("tests/snapshots/add/git_external.in"); + let cwd = &project_root; + + cargo_command() + .arg("add") + .args([ + "cargo-edit", + "--git", + "https://github.com/killercup/cargo-edit.git", + "--tag", + "v0.8.0", + "-Zgit", + ]) + .current_dir(cwd) + .assert() + .success() + .stdout_matches_path("tests/snapshots/add/git_external.stdout") + .stderr_matches_path("tests/snapshots/add/git_external.stderr"); + + assert().subset_matches("tests/snapshots/add/git_external.out", &project_root); +} + +#[cargo_test] +fn git_rev() { + init_registry(); + let project_root = project_from_template("tests/snapshots/add/git_rev.in"); + let cwd = &project_root; + + cargo_command() + .arg("add") + .args([ + "git-package", + "--git", + "http://localhost/git-package.git", + "--rev", + "423a3", + "-Zgit", + ]) + .current_dir(cwd) + .assert() + .success() + .stdout_matches_path("tests/snapshots/add/git_rev.stdout") + .stderr_matches_path("tests/snapshots/add/git_rev.stderr"); + + assert().subset_matches("tests/snapshots/add/git_rev.out", &project_root); +} + +#[cargo_test] +fn git_tag() { + init_registry(); + let project_root = project_from_template("tests/snapshots/add/git_tag.in"); + let cwd = &project_root; + + cargo_command() + .arg("add") + .args([ + "git-package", + "--git", + "http://localhost/git-package.git", + "--tag", + "v1.0.0", + "-Zgit", + ]) + .current_dir(cwd) + .assert() + .success() + .stdout_matches_path("tests/snapshots/add/git_tag.stdout") + .stderr_matches_path("tests/snapshots/add/git_tag.stderr"); + + assert().subset_matches("tests/snapshots/add/git_tag.out", &project_root); +} + +#[cargo_test] +fn inline_path() { + init_registry(); + let project_root = project_from_template("tests/snapshots/add/inline_path.in"); + let cwd = project_root.join("primary"); + + cargo_command() + .arg("add") + .args(["../dependency"]) + .current_dir(&cwd) + .assert() + .success() + .stdout_matches_path("tests/snapshots/add/inline_path.stdout") + .stderr_matches_path("tests/snapshots/add/inline_path.stderr"); + + assert().subset_matches("tests/snapshots/add/inline_path.out", &project_root); +} + +#[cargo_test] +fn inline_path_dev() { + init_registry(); + let project_root = project_from_template("tests/snapshots/add/inline_path_dev.in"); + let cwd = project_root.join("primary"); + + cargo_command() + .arg("add") + .args(["../dependency", "--dev"]) + .current_dir(&cwd) + .assert() + .success() + .stdout_matches_path("tests/snapshots/add/inline_path_dev.stdout") + .stderr_matches_path("tests/snapshots/add/inline_path_dev.stderr"); + + assert().subset_matches("tests/snapshots/add/inline_path_dev.out", &project_root); +} + +#[cargo_test] +fn invalid_arg() { + init_registry(); + let project_root = project_from_template("tests/snapshots/add/invalid_arg.in"); + let cwd = &project_root; + + cargo_command() + .arg("add") + .args(["my-package", "--flag"]) + .current_dir(cwd) + .assert() + .code(2) + .stdout_matches_path("tests/snapshots/add/invalid_arg.stdout") + .stderr_matches_path("tests/snapshots/add/invalid_arg.stderr"); + + assert().subset_matches("tests/snapshots/add/invalid_arg.out", &project_root); +} + +#[cargo_test] +#[cfg(feature = "test-external-apis")] +fn invalid_git_external() { + init_registry(); + let project_root = project_from_template("tests/snapshots/add/invalid_git_external.in"); + let cwd = &project_root; + + cargo_command() + .arg("add") + .args([ + "fake-git", + "--git", + "https://github.com/killercup/fake-git-repo.git", + "-Zgit", + ]) + .current_dir(cwd) + .assert() + .code(1) + .stdout_matches_path("tests/snapshots/add/invalid_git_external.stdout") + .stderr_matches_path("tests/snapshots/add/invalid_git_external.stderr"); + + assert().subset_matches( + "tests/snapshots/add/invalid_git_external.out", + &project_root, + ); +} + +#[cargo_test] +fn invalid_git_no_unstable() { + init_registry(); + let project_root = project_from_template("tests/snapshots/add/invalid_git_no_unstable.in"); + let cwd = &project_root; + + cargo_command() + .arg("add") + .args(["git-package", "--git", "http://localhost/git-package.git"]) + .current_dir(cwd) + .assert() + .code(1) + .stdout_matches_path("tests/snapshots/add/invalid_git_no_unstable.stdout") + .stderr_matches_path("tests/snapshots/add/invalid_git_no_unstable.stderr"); + + assert().subset_matches( + "tests/snapshots/add/invalid_git_no_unstable.out", + &project_root, + ); +} + +#[cargo_test] +fn invalid_inline_path() { + init_registry(); + let project_root = project_from_template("tests/snapshots/add/invalid_inline_path.in"); + let cwd = &project_root; + + cargo_command() + .arg("add") + .args(["./tests/fixtures/local"]) + .current_dir(cwd) + .assert() + .code(1) + .stdout_matches_path("tests/snapshots/add/invalid_inline_path.stdout") + .stderr_matches_path("tests/snapshots/add/invalid_inline_path.stderr"); + + assert().subset_matches("tests/snapshots/add/invalid_inline_path.out", &project_root); +} + +#[cargo_test] +fn invalid_inline_path_self() { + init_registry(); + let project_root = project_from_template("tests/snapshots/add/invalid_inline_path_self.in"); + let cwd = &project_root; + + cargo_command() + .arg("add") + .args(["."]) + .current_dir(cwd) + .assert() + .code(1) + .stdout_matches_path("tests/snapshots/add/invalid_inline_path_self.stdout") + .stderr_matches_path("tests/snapshots/add/invalid_inline_path_self.stderr"); + + assert().subset_matches( + "tests/snapshots/add/invalid_inline_path_self.out", + &project_root, + ); +} + +#[cargo_test] +fn invalid_manifest() { + init_registry(); + let project_root = project_from_template("tests/snapshots/add/invalid_manifest.in"); + let cwd = &project_root; + + cargo_command() + .arg("add") + .args(["my-package"]) + .current_dir(cwd) + .assert() + .code(1) + .stdout_matches_path("tests/snapshots/add/invalid_manifest.stdout") + .stderr_matches_path("tests/snapshots/add/invalid_manifest.stderr"); + + assert().subset_matches("tests/snapshots/add/invalid_manifest.out", &project_root); +} + +#[cargo_test] +fn invalid_name_external() { + init_registry(); + let project_root = project_from_template("tests/snapshots/add/invalid_name_external.in"); + let cwd = &project_root; + + cargo_command() + .arg("add") + .args(["lets_hope_nobody_ever_publishes_this_crate"]) + .current_dir(cwd) + .assert() + .code(1) + .stdout_matches_path("tests/snapshots/add/invalid_name_external.stdout") + .stderr_matches_path("tests/snapshots/add/invalid_name_external.stderr"); + + assert().subset_matches( + "tests/snapshots/add/invalid_name_external.out", + &project_root, + ); +} + +#[cargo_test] +fn invalid_target_empty() { + init_registry(); + let project_root = project_from_template("tests/snapshots/add/invalid_target_empty.in"); + let cwd = &project_root; + + cargo_command() + .arg("add") + .args(["my-package", "--target", ""]) + .current_dir(cwd) + .assert() + .code(2) + .stdout_matches_path("tests/snapshots/add/invalid_target_empty.stdout") + .stderr_matches_path("tests/snapshots/add/invalid_target_empty.stderr"); + + assert().subset_matches( + "tests/snapshots/add/invalid_target_empty.out", + &project_root, + ); +} + +#[cargo_test] +fn invalid_vers() { + init_registry(); + let project_root = project_from_template("tests/snapshots/add/invalid_vers.in"); + let cwd = &project_root; + + cargo_command() + .arg("add") + .args(["my-package@invalid version string"]) + .current_dir(cwd) + .assert() + .code(1) + .stdout_matches_path("tests/snapshots/add/invalid_vers.stdout") + .stderr_matches_path("tests/snapshots/add/invalid_vers.stderr"); + + assert().subset_matches("tests/snapshots/add/invalid_vers.out", &project_root); +} + +#[cargo_test] +fn list_features() { + init_registry(); + let project_root = project_from_template("tests/snapshots/add/list_features.in"); + let cwd = &project_root; + + cargo_command() + .arg("add") + .args(["your-face"]) + .current_dir(cwd) + .assert() + .success() + .stdout_matches_path("tests/snapshots/add/list_features.stdout") + .stderr_matches_path("tests/snapshots/add/list_features.stderr"); + + assert().subset_matches("tests/snapshots/add/list_features.out", &project_root); +} + +#[cargo_test] +fn list_features_path() { + init_registry(); + let project_root = project_from_template("tests/snapshots/add/list_features_path.in"); + let cwd = project_root.join("primary"); + + cargo_command() + .arg("add") + .args(["cargo-list-test-fixture-dependency", "../dependency"]) + .current_dir(&cwd) + .assert() + .success() + .stdout_matches_path("tests/snapshots/add/list_features_path.stdout") + .stderr_matches_path("tests/snapshots/add/list_features_path.stderr"); + + assert().subset_matches("tests/snapshots/add/list_features_path.out", &project_root); +} + +#[cargo_test] +fn list_features_path_no_default() { + init_registry(); + let project_root = + project_from_template("tests/snapshots/add/list_features_path_no_default.in"); + let cwd = project_root.join("primary"); + + cargo_command() + .arg("add") + .args([ + "cargo-list-test-fixture-dependency", + "../dependency", + "--no-default-features", + ]) + .current_dir(&cwd) + .assert() + .success() + .stdout_matches_path("tests/snapshots/add/list_features_path_no_default.stdout") + .stderr_matches_path("tests/snapshots/add/list_features_path_no_default.stderr"); + + assert().subset_matches( + "tests/snapshots/add/list_features_path_no_default.out", + &project_root, + ); +} + +#[cargo_test] +fn manifest_path_package() { + init_registry(); + let project_root = project_from_template("tests/snapshots/add/manifest_path_package.in"); + let cwd = &project_root; + + cargo_command() + .arg("add") + .args([ + "--manifest-path", + "Cargo.toml", + "--package", + "cargo-list-test-fixture", + "cargo-list-test-fixture-dependency", + ]) + .current_dir(cwd) + .assert() + .success() + .stdout_matches_path("tests/snapshots/add/manifest_path_package.stdout") + .stderr_matches_path("tests/snapshots/add/manifest_path_package.stderr"); + + assert().subset_matches( + "tests/snapshots/add/manifest_path_package.out", + &project_root, + ); +} + +#[cargo_test] +fn multiple_conflicts_with_features() { + init_registry(); + let project_root = + project_from_template("tests/snapshots/add/multiple_conflicts_with_features.in"); + let cwd = &project_root; + + cargo_command() + .arg("add") + .args(["my-package1", "your-face", "--features", "nose"]) + .current_dir(cwd) + .assert() + .code(1) + .stdout_matches_path("tests/snapshots/add/multiple_conflicts_with_features.stdout") + .stderr_matches_path("tests/snapshots/add/multiple_conflicts_with_features.stderr"); + + assert().subset_matches( + "tests/snapshots/add/multiple_conflicts_with_features.out", + &project_root, + ); +} + +#[cargo_test] +fn multiple_conflicts_with_git() { + init_registry(); + let project_root = project_from_template("tests/snapshots/add/multiple_conflicts_with_git.in"); + let cwd = &project_root; + + cargo_command() + .arg("add") + .args([ + "my-package1", + "my-package2", + "--git", + "https://github.com/dcjanus/invalid", + "-Zgit", + ]) + .current_dir(cwd) + .assert() + .code(1) + .stdout_matches_path("tests/snapshots/add/multiple_conflicts_with_git.stdout") + .stderr_matches_path("tests/snapshots/add/multiple_conflicts_with_git.stderr"); + + assert().subset_matches( + "tests/snapshots/add/multiple_conflicts_with_git.out", + &project_root, + ); +} + +#[cargo_test] +fn multiple_conflicts_with_rename() { + init_registry(); + let project_root = + project_from_template("tests/snapshots/add/multiple_conflicts_with_rename.in"); + let cwd = &project_root; + + cargo_command() + .arg("add") + .args(["my-package1", "my-package2", "--rename", "renamed"]) + .current_dir(cwd) + .assert() + .code(1) + .stdout_matches_path("tests/snapshots/add/multiple_conflicts_with_rename.stdout") + .stderr_matches_path("tests/snapshots/add/multiple_conflicts_with_rename.stderr"); + + assert().subset_matches( + "tests/snapshots/add/multiple_conflicts_with_rename.out", + &project_root, + ); +} + +#[cargo_test] +fn namever() { + init_registry(); + let project_root = project_from_template("tests/snapshots/add/namever.in"); + let cwd = &project_root; + + cargo_command() + .arg("add") + .args(["my-package1@>=0.1.1", "my-package2@0.2.3", "my-package"]) + .current_dir(cwd) + .assert() + .success() + .stdout_matches_path("tests/snapshots/add/namever.stdout") + .stderr_matches_path("tests/snapshots/add/namever.stderr"); + + assert().subset_matches("tests/snapshots/add/namever.out", &project_root); +} + +#[cargo_test] +fn no_args() { + init_registry(); + let project_root = project_from_template("tests/snapshots/add/no_args.in"); + let cwd = &project_root; + + cargo_command() + .arg("add") + .current_dir(cwd) + .assert() + .code(2) + .stdout_matches_path("tests/snapshots/add/no_args.stdout") + .stderr_matches_path("tests/snapshots/add/no_args.stderr"); + + assert().subset_matches("tests/snapshots/add/no_args.out", &project_root); +} + +#[cargo_test] +fn no_default_features() { + init_registry(); + let project_root = project_from_template("tests/snapshots/add/no_default_features.in"); + let cwd = &project_root; + + cargo_command() + .arg("add") + .args(["my-package1", "my-package2@0.4.1", "--no-default-features"]) + .current_dir(cwd) + .assert() + .success() + .stdout_matches_path("tests/snapshots/add/no_default_features.stdout") + .stderr_matches_path("tests/snapshots/add/no_default_features.stderr"); + + assert().subset_matches("tests/snapshots/add/no_default_features.out", &project_root); +} + +#[cargo_test] +fn no_optional() { + init_registry(); + let project_root = project_from_template("tests/snapshots/add/no_optional.in"); + let cwd = &project_root; + + cargo_command() + .arg("add") + .args(["my-package1", "my-package2@0.4.1", "--no-optional"]) + .current_dir(cwd) + .assert() + .success() + .stdout_matches_path("tests/snapshots/add/no_optional.stdout") + .stderr_matches_path("tests/snapshots/add/no_optional.stderr"); + + assert().subset_matches("tests/snapshots/add/no_optional.out", &project_root); +} + +#[cargo_test] +fn optional() { + init_registry(); + let project_root = project_from_template("tests/snapshots/add/optional.in"); + let cwd = &project_root; + + cargo_command() + .arg("add") + .args(["my-package1", "my-package2@0.4.1", "--optional"]) + .current_dir(cwd) + .assert() + .success() + .stdout_matches_path("tests/snapshots/add/optional.stdout") + .stderr_matches_path("tests/snapshots/add/optional.stderr"); + + assert().subset_matches("tests/snapshots/add/optional.out", &project_root); +} + +#[cargo_test] +fn overwrite_default_features() { + init_registry(); + let project_root = project_from_template("tests/snapshots/add/overwrite_default_features.in"); + let cwd = &project_root; + + cargo_command() + .arg("add") + .args(["my-package1", "my-package2@0.4.1", "--default-features"]) + .current_dir(cwd) + .assert() + .success() + .stdout_matches_path("tests/snapshots/add/overwrite_default_features.stdout") + .stderr_matches_path("tests/snapshots/add/overwrite_default_features.stderr"); + + assert().subset_matches( + "tests/snapshots/add/overwrite_default_features.out", + &project_root, + ); +} + +#[cargo_test] +fn overwrite_default_features_with_no_default_features() { + init_registry(); + let project_root = project_from_template( + "tests/snapshots/add/overwrite_default_features_with_no_default_features.in", + ); + let cwd = &project_root; + + cargo_command() + .arg("add") + .args(["my-package1", "my-package2@0.4.1", "--no-default-features"]) + .current_dir(cwd) + .assert() + .success() + .stdout_matches_path( + "tests/snapshots/add/overwrite_default_features_with_no_default_features.stdout", + ) + .stderr_matches_path( + "tests/snapshots/add/overwrite_default_features_with_no_default_features.stderr", + ); + + assert().subset_matches( + "tests/snapshots/add/overwrite_default_features_with_no_default_features.out", + &project_root, + ); +} + +#[cargo_test] +fn overwrite_features() { + init_registry(); + let project_root = project_from_template("tests/snapshots/add/overwrite_features.in"); + let cwd = &project_root; + + cargo_command() + .arg("add") + .args(["your-face", "--features", "nose"]) + .current_dir(cwd) + .assert() + .success() + .stdout_matches_path("tests/snapshots/add/overwrite_features.stdout") + .stderr_matches_path("tests/snapshots/add/overwrite_features.stderr"); + + assert().subset_matches("tests/snapshots/add/overwrite_features.out", &project_root); +} + +#[cargo_test] +fn overwrite_git_with_inline_path() { + init_registry(); + let project_root = + project_from_template("tests/snapshots/add/overwrite_git_with_inline_path.in"); + let cwd = project_root.join("primary"); + + cargo_command() + .arg("add") + .args(["../dependency"]) + .current_dir(&cwd) + .assert() + .success() + .stdout_matches_path("tests/snapshots/add/overwrite_git_with_inline_path.stdout") + .stderr_matches_path("tests/snapshots/add/overwrite_git_with_inline_path.stderr"); + + assert().subset_matches( + "tests/snapshots/add/overwrite_git_with_inline_path.out", + &project_root, + ); +} + +#[cargo_test] +fn overwrite_inline_features() { + init_registry(); + let project_root = project_from_template("tests/snapshots/add/overwrite_inline_features.in"); + let cwd = &project_root; + + cargo_command() + .arg("add") + .args([ + "unrelateed-crate", + "your-face", + "+nose,mouth", + "+ears", + "-Zinline-add", + ]) + .current_dir(cwd) + .assert() + .success() + .stdout_matches_path("tests/snapshots/add/overwrite_inline_features.stdout") + .stderr_matches_path("tests/snapshots/add/overwrite_inline_features.stderr"); + + assert().subset_matches( + "tests/snapshots/add/overwrite_inline_features.out", + &project_root, + ); +} + +#[cargo_test] +fn overwrite_name_dev_noop() { + init_alt_registry(); + let project_root = project_from_template("tests/snapshots/add/overwrite_name_dev_noop.in"); + let cwd = &project_root; + + cargo_command() + .arg("add") + .args(["cargo-list-test-fixture-dependency", "--dev"]) + .current_dir(cwd) + .assert() + .success() + .stdout_matches_path("tests/snapshots/add/overwrite_name_dev_noop.stdout") + .stderr_matches_path("tests/snapshots/add/overwrite_name_dev_noop.stderr"); + + assert().subset_matches( + "tests/snapshots/add/overwrite_name_dev_noop.out", + &project_root, + ); +} + +#[cargo_test] +fn overwrite_name_noop() { + init_alt_registry(); + let project_root = project_from_template("tests/snapshots/add/overwrite_name_noop.in"); + let cwd = &project_root; + + cargo_command() + .arg("add") + .args(["cargo-list-test-fixture-dependency"]) + .current_dir(cwd) + .assert() + .success() + .stdout_matches_path("tests/snapshots/add/overwrite_name_noop.stdout") + .stderr_matches_path("tests/snapshots/add/overwrite_name_noop.stderr"); + + assert().subset_matches("tests/snapshots/add/overwrite_name_noop.out", &project_root); +} + +#[cargo_test] +fn overwrite_no_default_features() { + init_registry(); + let project_root = + project_from_template("tests/snapshots/add/overwrite_no_default_features.in"); + let cwd = &project_root; + + cargo_command() + .arg("add") + .args(["my-package1", "my-package2@0.4.1", "--no-default-features"]) + .current_dir(cwd) + .assert() + .success() + .stdout_matches_path("tests/snapshots/add/overwrite_no_default_features.stdout") + .stderr_matches_path("tests/snapshots/add/overwrite_no_default_features.stderr"); + + assert().subset_matches( + "tests/snapshots/add/overwrite_no_default_features.out", + &project_root, + ); +} + +#[cargo_test] +fn overwrite_no_default_features_with_default_features() { + init_registry(); + let project_root = project_from_template( + "tests/snapshots/add/overwrite_no_default_features_with_default_features.in", + ); + let cwd = &project_root; + + cargo_command() + .arg("add") + .args(["my-package1", "my-package2@0.4.1", "--default-features"]) + .current_dir(cwd) + .assert() + .success() + .stdout_matches_path( + "tests/snapshots/add/overwrite_no_default_features_with_default_features.stdout", + ) + .stderr_matches_path( + "tests/snapshots/add/overwrite_no_default_features_with_default_features.stderr", + ); + + assert().subset_matches( + "tests/snapshots/add/overwrite_no_default_features_with_default_features.out", + &project_root, + ); +} + +#[cargo_test] +fn overwrite_no_optional() { + init_registry(); + let project_root = project_from_template("tests/snapshots/add/overwrite_no_optional.in"); + let cwd = &project_root; + + cargo_command() + .arg("add") + .args(["my-package1", "my-package2@0.4.1", "--no-optional"]) + .current_dir(cwd) + .assert() + .success() + .stdout_matches_path("tests/snapshots/add/overwrite_no_optional.stdout") + .stderr_matches_path("tests/snapshots/add/overwrite_no_optional.stderr"); + + assert().subset_matches( + "tests/snapshots/add/overwrite_no_optional.out", + &project_root, + ); +} + +#[cargo_test] +fn overwrite_no_optional_with_optional() { + init_registry(); + let project_root = + project_from_template("tests/snapshots/add/overwrite_no_optional_with_optional.in"); + let cwd = &project_root; + + cargo_command() + .arg("add") + .args(["my-package1", "my-package2@0.4.1", "--optional"]) + .current_dir(cwd) + .assert() + .success() + .stdout_matches_path("tests/snapshots/add/overwrite_no_optional_with_optional.stdout") + .stderr_matches_path("tests/snapshots/add/overwrite_no_optional_with_optional.stderr"); + + assert().subset_matches( + "tests/snapshots/add/overwrite_no_optional_with_optional.out", + &project_root, + ); +} + +#[cargo_test] +fn overwrite_optional() { + init_registry(); + let project_root = project_from_template("tests/snapshots/add/overwrite_optional.in"); + let cwd = &project_root; + + cargo_command() + .arg("add") + .args(["my-package1", "my-package2@0.4.1", "--optional"]) + .current_dir(cwd) + .assert() + .success() + .stdout_matches_path("tests/snapshots/add/overwrite_optional.stdout") + .stderr_matches_path("tests/snapshots/add/overwrite_optional.stderr"); + + assert().subset_matches("tests/snapshots/add/overwrite_optional.out", &project_root); +} + +#[cargo_test] +fn overwrite_optional_with_no_optional() { + init_registry(); + let project_root = + project_from_template("tests/snapshots/add/overwrite_optional_with_no_optional.in"); + let cwd = &project_root; + + cargo_command() + .arg("add") + .args(["my-package1", "my-package2@0.4.1", "--no-optional"]) + .current_dir(cwd) + .assert() + .success() + .stdout_matches_path("tests/snapshots/add/overwrite_optional_with_no_optional.stdout") + .stderr_matches_path("tests/snapshots/add/overwrite_optional_with_no_optional.stderr"); + + assert().subset_matches( + "tests/snapshots/add/overwrite_optional_with_no_optional.out", + &project_root, + ); +} + +#[cargo_test] +fn overwrite_path_noop() { + init_alt_registry(); + let project_root = project_from_template("tests/snapshots/add/overwrite_path_noop.in"); + let cwd = &project_root; + + cargo_command() + .arg("add") + .args(["./dependency"]) + .current_dir(cwd) + .assert() + .success() + .stdout_matches_path("tests/snapshots/add/overwrite_path_noop.stdout") + .stderr_matches_path("tests/snapshots/add/overwrite_path_noop.stderr"); + + assert().subset_matches("tests/snapshots/add/overwrite_path_noop.out", &project_root); +} + +#[cargo_test] +fn overwrite_path_with_version() { + init_registry(); + let project_root = project_from_template("tests/snapshots/add/overwrite_path_with_version.in"); + let cwd = project_root.join("primary"); + + cargo_command() + .arg("add") + .args(["cargo-list-test-fixture-dependency@20.0"]) + .current_dir(&cwd) + .assert() + .success() + .stdout_matches_path("tests/snapshots/add/overwrite_path_with_version.stdout") + .stderr_matches_path("tests/snapshots/add/overwrite_path_with_version.stderr"); + + assert().subset_matches( + "tests/snapshots/add/overwrite_path_with_version.out", + &project_root, + ); +} + +#[cargo_test] +fn overwrite_rename_with_no_rename() { + init_registry(); + let project_root = + project_from_template("tests/snapshots/add/overwrite_rename_with_no_rename.in"); + let cwd = &project_root; + + cargo_command() + .arg("add") + .args(["versioned-package"]) + .current_dir(cwd) + .assert() + .success() + .stdout_matches_path("tests/snapshots/add/overwrite_rename_with_no_rename.stdout") + .stderr_matches_path("tests/snapshots/add/overwrite_rename_with_no_rename.stderr"); + + assert().subset_matches( + "tests/snapshots/add/overwrite_rename_with_no_rename.out", + &project_root, + ); +} + +#[cargo_test] +fn overwrite_rename_with_rename() { + init_registry(); + let project_root = project_from_template("tests/snapshots/add/overwrite_rename_with_rename.in"); + let cwd = &project_root; + + cargo_command() + .arg("add") + .args(["versioned-package", "--rename", "a2"]) + .current_dir(cwd) + .assert() + .success() + .stdout_matches_path("tests/snapshots/add/overwrite_rename_with_rename.stdout") + .stderr_matches_path("tests/snapshots/add/overwrite_rename_with_rename.stderr"); + + assert().subset_matches( + "tests/snapshots/add/overwrite_rename_with_rename.out", + &project_root, + ); +} + +#[cargo_test] +fn overwrite_rename_with_rename_noop() { + init_registry(); + let project_root = + project_from_template("tests/snapshots/add/overwrite_rename_with_rename_noop.in"); + let cwd = &project_root; + + cargo_command() + .arg("add") + .args(["versioned-package", "--rename", "a1"]) + .current_dir(cwd) + .assert() + .success() + .stdout_matches_path("tests/snapshots/add/overwrite_rename_with_rename_noop.stdout") + .stderr_matches_path("tests/snapshots/add/overwrite_rename_with_rename_noop.stderr"); + + assert().subset_matches( + "tests/snapshots/add/overwrite_rename_with_rename_noop.out", + &project_root, + ); +} + +#[cargo_test] +fn overwrite_version_with_git() { + init_registry(); + let project_root = project_from_template("tests/snapshots/add/overwrite_version_with_git.in"); + let cwd = &project_root; + + cargo_command() + .arg("add") + .args(["versioned-package", "--git", "git://git.git", "-Zgit"]) + .current_dir(cwd) + .assert() + .success() + .stdout_matches_path("tests/snapshots/add/overwrite_version_with_git.stdout") + .stderr_matches_path("tests/snapshots/add/overwrite_version_with_git.stderr"); + + assert().subset_matches( + "tests/snapshots/add/overwrite_version_with_git.out", + &project_root, + ); +} + +#[cargo_test] +fn overwrite_version_with_inline_path() { + init_registry(); + let project_root = + project_from_template("tests/snapshots/add/overwrite_version_with_inline_path.in"); + let cwd = project_root.join("primary"); + + cargo_command() + .arg("add") + .args(["../dependency"]) + .current_dir(&cwd) + .assert() + .success() + .stdout_matches_path("tests/snapshots/add/overwrite_version_with_inline_path.stdout") + .stderr_matches_path("tests/snapshots/add/overwrite_version_with_inline_path.stderr"); + + assert().subset_matches( + "tests/snapshots/add/overwrite_version_with_inline_path.out", + &project_root, + ); +} + +#[cargo_test] +fn overwrite_with_rename() { + init_registry(); + let project_root = project_from_template("tests/snapshots/add/overwrite_with_rename.in"); + let cwd = &project_root; + + cargo_command() + .arg("add") + .args(["versioned-package", "--rename", "renamed"]) + .current_dir(cwd) + .assert() + .success() + .stdout_matches_path("tests/snapshots/add/overwrite_with_rename.stdout") + .stderr_matches_path("tests/snapshots/add/overwrite_with_rename.stderr"); + + assert().subset_matches( + "tests/snapshots/add/overwrite_with_rename.out", + &project_root, + ); +} + +#[cargo_test] +fn preserve_sorted() { + init_registry(); + let project_root = project_from_template("tests/snapshots/add/preserve_sorted.in"); + let cwd = &project_root; + + cargo_command() + .arg("add") + .args(["toml"]) + .current_dir(cwd) + .assert() + .success() + .stdout_matches_path("tests/snapshots/add/preserve_sorted.stdout") + .stderr_matches_path("tests/snapshots/add/preserve_sorted.stderr"); + + assert().subset_matches("tests/snapshots/add/preserve_sorted.out", &project_root); +} + +#[cargo_test] +fn preserve_unsorted() { + init_registry(); + let project_root = project_from_template("tests/snapshots/add/preserve_unsorted.in"); + let cwd = &project_root; + + cargo_command() + .arg("add") + .args(["toml"]) + .current_dir(cwd) + .assert() + .success() + .stdout_matches_path("tests/snapshots/add/preserve_unsorted.stdout") + .stderr_matches_path("tests/snapshots/add/preserve_unsorted.stderr"); + + assert().subset_matches("tests/snapshots/add/preserve_unsorted.out", &project_root); +} + +#[cargo_test] +fn registry() { + init_alt_registry(); + let project_root = project_from_template("tests/snapshots/add/registry.in"); + let cwd = &project_root; + + cargo_command() + .arg("add") + .args(["my-package1", "my-package2", "--registry", "alternative"]) + .current_dir(cwd) + .assert() + .success() + .stdout_matches_path("tests/snapshots/add/registry.stdout") + .stderr_matches_path("tests/snapshots/add/registry.stderr"); + + assert().subset_matches("tests/snapshots/add/registry.out", &project_root); +} + +#[cargo_test] +fn rename() { + init_registry(); + let project_root = project_from_template("tests/snapshots/add/rename.in"); + let cwd = &project_root; + + cargo_command() + .arg("add") + .args(["my-package", "--rename", "renamed"]) + .current_dir(cwd) + .assert() + .success() + .stdout_matches_path("tests/snapshots/add/rename.stdout") + .stderr_matches_path("tests/snapshots/add/rename.stderr"); + + assert().subset_matches("tests/snapshots/add/rename.out", &project_root); +} + +#[cargo_test] +fn target() { + init_registry(); + let project_root = project_from_template("tests/snapshots/add/target.in"); + let cwd = &project_root; + + cargo_command() + .arg("add") + .args([ + "my-package1", + "my-package2", + "--target", + "i686-unknown-linux-gnu", + ]) + .current_dir(cwd) + .assert() + .success() + .stdout_matches_path("tests/snapshots/add/target.stdout") + .stderr_matches_path("tests/snapshots/add/target.stderr"); + + assert().subset_matches("tests/snapshots/add/target.out", &project_root); +} + +#[cargo_test] +fn target_cfg() { + init_registry(); + let project_root = project_from_template("tests/snapshots/add/target_cfg.in"); + let cwd = &project_root; + + cargo_command() + .arg("add") + .args(["my-package1", "my-package2", "--target", "cfg(unix)"]) + .current_dir(cwd) + .assert() + .success() + .stdout_matches_path("tests/snapshots/add/target_cfg.stdout") + .stderr_matches_path("tests/snapshots/add/target_cfg.stderr"); + + assert().subset_matches("tests/snapshots/add/target_cfg.out", &project_root); +} + +#[cargo_test] +fn vers() { + init_registry(); + let project_root = project_from_template("tests/snapshots/add/vers.in"); + let cwd = &project_root; + + cargo_command() + .arg("add") + .args(["my-package@>=0.1.1"]) + .current_dir(cwd) + .assert() + .success() + .stdout_matches_path("tests/snapshots/add/vers.stdout") + .stderr_matches_path("tests/snapshots/add/vers.stderr"); + + assert().subset_matches("tests/snapshots/add/vers.out", &project_root); +} + +#[cargo_test] +fn workspace_inline_path() { + init_registry(); + let project_root = project_from_template("tests/snapshots/add/workspace_inline_path.in"); + let cwd = project_root.join("primary"); + + cargo_command() + .arg("add") + .args(["../dependency"]) + .current_dir(&cwd) + .assert() + .success() + .stdout_matches_path("tests/snapshots/add/workspace_inline_path.stdout") + .stderr_matches_path("tests/snapshots/add/workspace_inline_path.stderr"); + + assert().subset_matches( + "tests/snapshots/add/workspace_inline_path.out", + &project_root, + ); +} + +#[cargo_test] +fn workspace_inline_path_dev() { + init_registry(); + let project_root = project_from_template("tests/snapshots/add/workspace_inline_path_dev.in"); + let cwd = project_root.join("primary"); + + cargo_command() + .arg("add") + .args(["../dependency", "--dev"]) + .current_dir(&cwd) + .assert() + .success() + .stdout_matches_path("tests/snapshots/add/workspace_inline_path_dev.stdout") + .stderr_matches_path("tests/snapshots/add/workspace_inline_path_dev.stderr"); + + assert().subset_matches( + "tests/snapshots/add/workspace_inline_path_dev.out", + &project_root, + ); +} + +#[cargo_test] +fn workspace_name() { + init_registry(); + let project_root = project_from_template("tests/snapshots/add/workspace_name.in"); + let cwd = project_root.join("primary"); + + cargo_command() + .arg("add") + .args(["cargo-list-test-fixture-dependency"]) + .current_dir(&cwd) + .assert() + .success() + .stdout_matches_path("tests/snapshots/add/workspace_name.stdout") + .stderr_matches_path("tests/snapshots/add/workspace_name.stderr"); + + assert().subset_matches("tests/snapshots/add/workspace_name.out", &project_root); } diff --git a/crates/cargo-add/tests/cmd/add/add_basic.toml b/crates/cargo-add/tests/cmd/add/add_basic.toml deleted file mode 100644 index 3542cd57fb..0000000000 --- a/crates/cargo-add/tests/cmd/add/add_basic.toml +++ /dev/null @@ -1,11 +0,0 @@ -bin.name = "cargo-add" -args = ["add", "my-package"] -status = "success" -stdout = "" -stderr = """ - Adding my-package v99999.0.0 to dependencies. -""" -fs.sandbox = true - -[env.add] -CARGO_IS_TEST="1" diff --git a/crates/cargo-add/tests/cmd/add/add_multiple.toml b/crates/cargo-add/tests/cmd/add/add_multiple.toml deleted file mode 100644 index b3bbf07fad..0000000000 --- a/crates/cargo-add/tests/cmd/add/add_multiple.toml +++ /dev/null @@ -1,12 +0,0 @@ -bin.name = "cargo-add" -args = ["add", "my-package1", "my-package2"] -status = "success" -stdout = "" -stderr = """ - Adding my-package1 v99999.0.0 to dependencies. - Adding my-package2 v99999.0.0 to dependencies. -""" -fs.sandbox = true - -[env.add] -CARGO_IS_TEST="1" diff --git a/crates/cargo-add/tests/cmd/add/build.toml b/crates/cargo-add/tests/cmd/add/build.toml deleted file mode 100644 index e82ea0d62d..0000000000 --- a/crates/cargo-add/tests/cmd/add/build.toml +++ /dev/null @@ -1,12 +0,0 @@ -bin.name = "cargo-add" -args = ["add", "--build", "my-build-package1", "my-build-package2"] -status = "success" -stdout = "" -stderr = """ - Adding my-build-package1 v99999.0.0 to build-dependencies. - Adding my-build-package2 v99999.0.0 to build-dependencies. -""" -fs.sandbox = true - -[env.add] -CARGO_IS_TEST="1" diff --git a/crates/cargo-add/tests/cmd/add/build_prefer_existing_version.in/.cargo/config b/crates/cargo-add/tests/cmd/add/build_prefer_existing_version.in/.cargo/config deleted file mode 100644 index feb02f3c12..0000000000 --- a/crates/cargo-add/tests/cmd/add/build_prefer_existing_version.in/.cargo/config +++ /dev/null @@ -1,2 +0,0 @@ -[registries.alternative] -index = "https://github.com/ordian/crates.io-index" diff --git a/crates/cargo-add/tests/cmd/add/build_prefer_existing_version.toml b/crates/cargo-add/tests/cmd/add/build_prefer_existing_version.toml deleted file mode 100644 index 3792476af1..0000000000 --- a/crates/cargo-add/tests/cmd/add/build_prefer_existing_version.toml +++ /dev/null @@ -1,11 +0,0 @@ -bin.name = "cargo-add" -args = ["add", "cargo-list-test-fixture-dependency", "--build"] -status = "success" -stdout = "" -stderr = """ - Adding cargo-list-test-fixture-dependency (local) to build-dependencies. -""" -fs.sandbox = true - -[env.add] -CARGO_IS_TEST="1" diff --git a/crates/cargo-add/tests/cmd/add/cargo_config_source_empty.toml b/crates/cargo-add/tests/cmd/add/cargo_config_source_empty.toml deleted file mode 100644 index 3542cd57fb..0000000000 --- a/crates/cargo-add/tests/cmd/add/cargo_config_source_empty.toml +++ /dev/null @@ -1,11 +0,0 @@ -bin.name = "cargo-add" -args = ["add", "my-package"] -status = "success" -stdout = "" -stderr = """ - Adding my-package v99999.0.0 to dependencies. -""" -fs.sandbox = true - -[env.add] -CARGO_IS_TEST="1" diff --git a/crates/cargo-add/tests/cmd/add/default_features.toml b/crates/cargo-add/tests/cmd/add/default_features.toml deleted file mode 100644 index e0ac163693..0000000000 --- a/crates/cargo-add/tests/cmd/add/default_features.toml +++ /dev/null @@ -1,12 +0,0 @@ -bin.name = "cargo-add" -args = ["add", "my-package1", "my-package2@0.4.1", "--default-features"] -status = "success" -stdout = "" -stderr = """ - Adding my-package1 v99999.0.0 to dependencies. - Adding my-package2 v0.4.1 to dependencies. -""" -fs.sandbox = true - -[env.add] -CARGO_IS_TEST="1" diff --git a/crates/cargo-add/tests/cmd/add/dev.toml b/crates/cargo-add/tests/cmd/add/dev.toml deleted file mode 100644 index 72043d7f25..0000000000 --- a/crates/cargo-add/tests/cmd/add/dev.toml +++ /dev/null @@ -1,12 +0,0 @@ -bin.name = "cargo-add" -args = ["add", "--dev", "my-dev-package1", "my-dev-package2"] -status = "success" -stdout = "" -stderr = """ - Adding my-dev-package1 v99999.0.0 to dev-dependencies. - Adding my-dev-package2 v99999.0.0 to dev-dependencies. -""" -fs.sandbox = true - -[env.add] -CARGO_IS_TEST="1" diff --git a/crates/cargo-add/tests/cmd/add/dev_prefer_existing_version.in/.cargo/config b/crates/cargo-add/tests/cmd/add/dev_prefer_existing_version.in/.cargo/config deleted file mode 100644 index feb02f3c12..0000000000 --- a/crates/cargo-add/tests/cmd/add/dev_prefer_existing_version.in/.cargo/config +++ /dev/null @@ -1,2 +0,0 @@ -[registries.alternative] -index = "https://github.com/ordian/crates.io-index" diff --git a/crates/cargo-add/tests/cmd/add/dev_prefer_existing_version.toml b/crates/cargo-add/tests/cmd/add/dev_prefer_existing_version.toml deleted file mode 100644 index 7dfb9770da..0000000000 --- a/crates/cargo-add/tests/cmd/add/dev_prefer_existing_version.toml +++ /dev/null @@ -1,11 +0,0 @@ -bin.name = "cargo-add" -args = ["add", "cargo-list-test-fixture-dependency", "--dev"] -status = "success" -stdout = "" -stderr = """ - Adding cargo-list-test-fixture-dependency (local) to dev-dependencies. -""" -fs.sandbox = true - -[env.add] -CARGO_IS_TEST="1" diff --git a/crates/cargo-add/tests/cmd/add/dry_run.toml b/crates/cargo-add/tests/cmd/add/dry_run.toml deleted file mode 100644 index 1815ffe2dc..0000000000 --- a/crates/cargo-add/tests/cmd/add/dry_run.toml +++ /dev/null @@ -1,12 +0,0 @@ -bin.name = "cargo-add" -args = ["add", "my-package", "--dry-run"] -status = "success" -stdout = "" -stderr = """ - Adding my-package v99999.0.0 to dependencies. -warning: aborting add due to dry run -""" -fs.sandbox = true - -[env.add] -CARGO_IS_TEST="1" diff --git a/crates/cargo-add/tests/cmd/add/features.toml b/crates/cargo-add/tests/cmd/add/features.toml deleted file mode 100644 index 7f3d29ffeb..0000000000 --- a/crates/cargo-add/tests/cmd/add/features.toml +++ /dev/null @@ -1,16 +0,0 @@ -bin.name = "cargo-add" -args = ["add", "your-face", "--features", "eyes"] -status = "success" -stdout = "" -stderr = """ - Adding your-face v99999.0.0 to dependencies. - Features: - + eyes - - ears - - mouth - - nose -""" -fs.sandbox = true - -[env.add] -CARGO_IS_TEST="1" diff --git a/crates/cargo-add/tests/cmd/add/features_empty.toml b/crates/cargo-add/tests/cmd/add/features_empty.toml deleted file mode 100644 index 8fe6e48251..0000000000 --- a/crates/cargo-add/tests/cmd/add/features_empty.toml +++ /dev/null @@ -1,16 +0,0 @@ -bin.name = "cargo-add" -args = ["add", "your-face", "--features", ""] -status = "success" -stdout = "" -stderr = """ - Adding your-face v99999.0.0 to dependencies. - Features: - - ears - - eyes - - mouth - - nose -""" -fs.sandbox = true - -[env.add] -CARGO_IS_TEST="1" diff --git a/crates/cargo-add/tests/cmd/add/features_multiple_occurrences.toml b/crates/cargo-add/tests/cmd/add/features_multiple_occurrences.toml deleted file mode 100644 index b30ec62f8e..0000000000 --- a/crates/cargo-add/tests/cmd/add/features_multiple_occurrences.toml +++ /dev/null @@ -1,16 +0,0 @@ -bin.name = "cargo-add" -args = ["add", "your-face", "--features", "eyes", "--features", "nose"] -status = "success" -stdout = "" -stderr = """ - Adding your-face v99999.0.0 to dependencies. - Features: - + eyes - + nose - - ears - - mouth -""" -fs.sandbox = true - -[env.add] -CARGO_IS_TEST="1" diff --git a/crates/cargo-add/tests/cmd/add/features_spaced_values.toml b/crates/cargo-add/tests/cmd/add/features_spaced_values.toml deleted file mode 100644 index 2529bd905e..0000000000 --- a/crates/cargo-add/tests/cmd/add/features_spaced_values.toml +++ /dev/null @@ -1,16 +0,0 @@ -bin.name = "cargo-add" -args = ["add", "your-face", "--features", "eyes nose"] -status = "success" -stdout = "" -stderr = """ - Adding your-face v99999.0.0 to dependencies. - Features: - + eyes - + nose - - ears - - mouth -""" -fs.sandbox = true - -[env.add] -CARGO_IS_TEST="1" diff --git a/crates/cargo-add/tests/cmd/add/features_unknown.toml b/crates/cargo-add/tests/cmd/add/features_unknown.toml deleted file mode 100644 index d9ed67e584..0000000000 --- a/crates/cargo-add/tests/cmd/add/features_unknown.toml +++ /dev/null @@ -1,18 +0,0 @@ -bin.name = "cargo-add" -args = ["add", "your-face", "--features", "noze"] -status = "success" -stdout = "" -stderr = """ -warning: Unrecognized features: [\"noze\"] - Adding your-face v99999.0.0 to dependencies. - Features: - + noze - - ears - - eyes - - mouth - - nose -""" -fs.sandbox = true - -[env.add] -CARGO_IS_TEST="1" diff --git a/crates/cargo-add/tests/cmd/add/git.toml b/crates/cargo-add/tests/cmd/add/git.toml deleted file mode 100644 index 3702b9cff1..0000000000 --- a/crates/cargo-add/tests/cmd/add/git.toml +++ /dev/null @@ -1,11 +0,0 @@ -bin.name = "cargo-add" -args = ["add", "git-package", "--git", "http://localhost/git-package.git", "-Zgit"] -status = "success" -stdout = "" -stderr = """ - Adding git-package (git) to dependencies. -""" -fs.sandbox = true - -[env.add] -CARGO_IS_TEST="1" diff --git a/crates/cargo-add/tests/cmd/add/git_branch.toml b/crates/cargo-add/tests/cmd/add/git_branch.toml deleted file mode 100644 index cc68d496ba..0000000000 --- a/crates/cargo-add/tests/cmd/add/git_branch.toml +++ /dev/null @@ -1,11 +0,0 @@ -bin.name = "cargo-add" -args = ["add", "git-package", "--git", "http://localhost/git-package.git", "--branch", "main", "-Zgit"] -status = "success" -stdout = "" -stderr = """ - Adding git-package (git) to dependencies. -""" -fs.sandbox = true - -[env.add] -CARGO_IS_TEST="1" diff --git a/crates/cargo-add/tests/cmd/add/git_conflicts_namever.toml b/crates/cargo-add/tests/cmd/add/git_conflicts_namever.toml deleted file mode 100644 index ca80c9c2a9..0000000000 --- a/crates/cargo-add/tests/cmd/add/git_conflicts_namever.toml +++ /dev/null @@ -1,11 +0,0 @@ -bin.name = "cargo-add" -args = ["add", "my-package@0.4.3", "--git", "https://github.com/dcjanus/invalid", "-Zgit"] -status.code = 1 -stdout = "" -stderr = """ -Error: Cannot specify a git URL (`https://github.com/dcjanus/invalid`) with a version (`0.4.3`). -""" -fs.sandbox = true - -[env.add] -CARGO_IS_TEST="1" diff --git a/crates/cargo-add/tests/cmd/add/git_dev.toml b/crates/cargo-add/tests/cmd/add/git_dev.toml deleted file mode 100644 index 2a0cb96999..0000000000 --- a/crates/cargo-add/tests/cmd/add/git_dev.toml +++ /dev/null @@ -1,12 +0,0 @@ -# Ensure it works with other flags -bin.name = "cargo-add" -args = ["add", "git-package", "--git", "http://localhost/git-package.git", "--dev", "-Zgit"] -status = "success" -stdout = "" -stderr = """ - Adding git-package (git) to dev-dependencies. -""" -fs.sandbox = true - -[env.add] -CARGO_IS_TEST="1" diff --git a/crates/cargo-add/tests/cmd/add/git_rev.toml b/crates/cargo-add/tests/cmd/add/git_rev.toml deleted file mode 100644 index 06485d52a9..0000000000 --- a/crates/cargo-add/tests/cmd/add/git_rev.toml +++ /dev/null @@ -1,11 +0,0 @@ -bin.name = "cargo-add" -args = ["add", "git-package", "--git", "http://localhost/git-package.git", "--rev", "423a3", "-Zgit"] -status = "success" -stdout = "" -stderr = """ - Adding git-package (git) to dependencies. -""" -fs.sandbox = true - -[env.add] -CARGO_IS_TEST="1" diff --git a/crates/cargo-add/tests/cmd/add/git_tag.toml b/crates/cargo-add/tests/cmd/add/git_tag.toml deleted file mode 100644 index e5889c38ff..0000000000 --- a/crates/cargo-add/tests/cmd/add/git_tag.toml +++ /dev/null @@ -1,11 +0,0 @@ -bin.name = "cargo-add" -args = ["add", "git-package", "--git", "http://localhost/git-package.git", "--tag", "v1.0.0", "-Zgit"] -status = "success" -stdout = "" -stderr = """ - Adding git-package (git) to dependencies. -""" -fs.sandbox = true - -[env.add] -CARGO_IS_TEST="1" diff --git a/crates/cargo-add/tests/cmd/add/inline_path.toml b/crates/cargo-add/tests/cmd/add/inline_path.toml deleted file mode 100644 index aef763e783..0000000000 --- a/crates/cargo-add/tests/cmd/add/inline_path.toml +++ /dev/null @@ -1,12 +0,0 @@ -bin.name = "cargo-add" -args = ["add", "../dependency"] -status = "success" -stdout = "" -stderr = """ - Adding cargo-list-test-fixture-dependency (local) to dependencies. -""" -fs.sandbox = true -fs.cwd = "inline_path.in/primary" - -[env.add] -CARGO_IS_TEST="1" diff --git a/crates/cargo-add/tests/cmd/add/inline_path_dev.toml b/crates/cargo-add/tests/cmd/add/inline_path_dev.toml deleted file mode 100644 index 3495c79fe8..0000000000 --- a/crates/cargo-add/tests/cmd/add/inline_path_dev.toml +++ /dev/null @@ -1,12 +0,0 @@ -bin.name = "cargo-add" -args = ["add", "../dependency", "--dev"] -status = "success" -stdout = "" -stderr = """ - Adding cargo-list-test-fixture-dependency (local) to dev-dependencies. -""" -fs.sandbox = true -fs.cwd = "inline_path_dev.in/primary" - -[env.add] -CARGO_IS_TEST="1" diff --git a/crates/cargo-add/tests/cmd/add/invalid_git_no_unstable.toml b/crates/cargo-add/tests/cmd/add/invalid_git_no_unstable.toml deleted file mode 100644 index a11cb7a247..0000000000 --- a/crates/cargo-add/tests/cmd/add/invalid_git_no_unstable.toml +++ /dev/null @@ -1,11 +0,0 @@ -bin.name = "cargo-add" -args = ["add", "git-package", "--git", "http://localhost/git-package.git"] -status.code = 1 -stdout = "" -stderr = """ -Error: `--git` is unstable and requires `-Z git` -""" -fs.sandbox = true - -[env.add] -CARGO_IS_TEST="1" diff --git a/crates/cargo-add/tests/cmd/add/invalid_inline_path.toml b/crates/cargo-add/tests/cmd/add/invalid_inline_path.toml deleted file mode 100644 index 0f1b8fa046..0000000000 --- a/crates/cargo-add/tests/cmd/add/invalid_inline_path.toml +++ /dev/null @@ -1,15 +0,0 @@ -bin.name = "cargo-add" -args = ["add", "./tests/fixtures/local"] -status.code = 1 -stdout = "" -stderr = """ -Error: Unable to open local Cargo.toml - -Caused by: - 0: Failed to read manifest contents - 1: [..] -""" -fs.sandbox = true - -[env.add] -CARGO_IS_TEST="1" diff --git a/crates/cargo-add/tests/cmd/add/invalid_inline_path_self.toml b/crates/cargo-add/tests/cmd/add/invalid_inline_path_self.toml deleted file mode 100644 index 8f3a72a428..0000000000 --- a/crates/cargo-add/tests/cmd/add/invalid_inline_path_self.toml +++ /dev/null @@ -1,12 +0,0 @@ -bin.name = "cargo-add" -args = ["add", "."] -status.code = 1 -stdout = "" -stderr = """ - Adding cargo-list-test-fixture (local) to dependencies. -Error: Cannot add `cargo-list-test-fixture` as a dependency to itself -""" -fs.sandbox = true - -[env.add] -CARGO_IS_TEST="1" diff --git a/crates/cargo-add/tests/cmd/add/invalid_manifest.toml b/crates/cargo-add/tests/cmd/add/invalid_manifest.toml deleted file mode 100644 index 89e3ccd3c5..0000000000 --- a/crates/cargo-add/tests/cmd/add/invalid_manifest.toml +++ /dev/null @@ -1,20 +0,0 @@ -bin.name = "cargo-add" -args = ["add", "my-package"] -status.code = 1 -stdout = "" -stderr = """ -Error: failed to parse manifest at `[CWD]/Cargo.toml` - -Caused by: - 0: could not parse input as TOML - 1: TOML parse error at line 6, column 7 - | - 6 | key = invalid-value - | ^ - Unexpected `v` - -""" -fs.sandbox = true - -[env.add] -CARGO_IS_TEST="1" diff --git a/crates/cargo-add/tests/cmd/add/invalid_name_external.out/Cargo.toml b/crates/cargo-add/tests/cmd/add/invalid_name_external.out/Cargo.toml deleted file mode 100644 index 5e20016d71..0000000000 --- a/crates/cargo-add/tests/cmd/add/invalid_name_external.out/Cargo.toml +++ /dev/null @@ -1,3 +0,0 @@ -[package] -name = "cargo-list-test-fixture" -version = "0.0.0" diff --git a/crates/cargo-add/tests/cmd/add/invalid_name_external.toml b/crates/cargo-add/tests/cmd/add/invalid_name_external.toml deleted file mode 100644 index 7adfdbbc3c..0000000000 --- a/crates/cargo-add/tests/cmd/add/invalid_name_external.toml +++ /dev/null @@ -1,9 +0,0 @@ -bin.name = "cargo-add" -args = ["add", "lets_hope_nobody_ever_publishes_this_crate"] -status.code = 1 -stdout = "" -stderr = """ - Updating 'https://github.com/rust-lang/crates.io-index' index -Error: The crate `lets_hope_nobody_ever_publishes_this_crate` could not be found in registry index. -""" -fs.sandbox = true diff --git a/crates/cargo-add/tests/cmd/add/invalid_target_empty.out/Cargo.toml b/crates/cargo-add/tests/cmd/add/invalid_target_empty.out/Cargo.toml deleted file mode 100644 index 5e20016d71..0000000000 --- a/crates/cargo-add/tests/cmd/add/invalid_target_empty.out/Cargo.toml +++ /dev/null @@ -1,3 +0,0 @@ -[package] -name = "cargo-list-test-fixture" -version = "0.0.0" diff --git a/crates/cargo-add/tests/cmd/add/invalid_vers.out/Cargo.toml b/crates/cargo-add/tests/cmd/add/invalid_vers.out/Cargo.toml deleted file mode 100644 index 5e20016d71..0000000000 --- a/crates/cargo-add/tests/cmd/add/invalid_vers.out/Cargo.toml +++ /dev/null @@ -1,3 +0,0 @@ -[package] -name = "cargo-list-test-fixture" -version = "0.0.0" diff --git a/crates/cargo-add/tests/cmd/add/invalid_vers.toml b/crates/cargo-add/tests/cmd/add/invalid_vers.toml deleted file mode 100644 index fa8bb8da0a..0000000000 --- a/crates/cargo-add/tests/cmd/add/invalid_vers.toml +++ /dev/null @@ -1,14 +0,0 @@ -bin.name = "cargo-add" -args = ["add", "my-package@invalid version string"] -status.code = 1 -stdout = "" -stderr = """ -Error: Invalid version requirement `invalid version string` - -Caused by: - unexpected character 'i' while parsing major version number -""" -fs.sandbox = true - -[env.add] -CARGO_IS_TEST="1" diff --git a/crates/cargo-add/tests/cmd/add/list_features_path.in/primary/Cargo.toml b/crates/cargo-add/tests/cmd/add/list_features_path.in/primary/Cargo.toml deleted file mode 100644 index 5e20016d71..0000000000 --- a/crates/cargo-add/tests/cmd/add/list_features_path.in/primary/Cargo.toml +++ /dev/null @@ -1,3 +0,0 @@ -[package] -name = "cargo-list-test-fixture" -version = "0.0.0" diff --git a/crates/cargo-add/tests/cmd/add/list_features_path_no_default.in/primary/Cargo.toml b/crates/cargo-add/tests/cmd/add/list_features_path_no_default.in/primary/Cargo.toml deleted file mode 100644 index 5e20016d71..0000000000 --- a/crates/cargo-add/tests/cmd/add/list_features_path_no_default.in/primary/Cargo.toml +++ /dev/null @@ -1,3 +0,0 @@ -[package] -name = "cargo-list-test-fixture" -version = "0.0.0" diff --git a/crates/cargo-add/tests/cmd/add/list_features_path_no_default.toml b/crates/cargo-add/tests/cmd/add/list_features_path_no_default.toml deleted file mode 100644 index 14faaba604..0000000000 --- a/crates/cargo-add/tests/cmd/add/list_features_path_no_default.toml +++ /dev/null @@ -1,18 +0,0 @@ -bin.name = "cargo-add" -args = ["add", "cargo-list-test-fixture-dependency", "../dependency", "--no-default-features"] -status = "success" -stdout = "" -stderr = """ - Adding cargo-list-test-fixture-dependency v99999.0.0 to dependencies. - Adding your-face (local) to dependencies. - Features: - - eyes - - mouth - - nose - - optional-dependency -""" -fs.sandbox = true -fs.cwd = "list_features_path_no_default.in/primary" - -[env.add] -CARGO_IS_TEST="1" diff --git a/crates/cargo-add/tests/cmd/add/manifest_path_package.in/primary/Cargo.toml b/crates/cargo-add/tests/cmd/add/manifest_path_package.in/primary/Cargo.toml deleted file mode 100644 index 5e20016d71..0000000000 --- a/crates/cargo-add/tests/cmd/add/manifest_path_package.in/primary/Cargo.toml +++ /dev/null @@ -1,3 +0,0 @@ -[package] -name = "cargo-list-test-fixture" -version = "0.0.0" diff --git a/crates/cargo-add/tests/cmd/add/manifest_path_package.toml b/crates/cargo-add/tests/cmd/add/manifest_path_package.toml deleted file mode 100644 index d4dc0120b0..0000000000 --- a/crates/cargo-add/tests/cmd/add/manifest_path_package.toml +++ /dev/null @@ -1,11 +0,0 @@ -bin.name = "cargo-add" -args = ["add", "--manifest-path", "Cargo.toml", "--package", "cargo-list-test-fixture", "cargo-list-test-fixture-dependency"] -status = "success" -stdout = "" -stderr = """ - Adding cargo-list-test-fixture-dependency (local) to dependencies. -""" -fs.sandbox = true - -[env.add] -CARGO_IS_TEST="1" diff --git a/crates/cargo-add/tests/cmd/add/multiple_conflicts_with_features.out/Cargo.toml b/crates/cargo-add/tests/cmd/add/multiple_conflicts_with_features.out/Cargo.toml deleted file mode 100644 index 5e20016d71..0000000000 --- a/crates/cargo-add/tests/cmd/add/multiple_conflicts_with_features.out/Cargo.toml +++ /dev/null @@ -1,3 +0,0 @@ -[package] -name = "cargo-list-test-fixture" -version = "0.0.0" diff --git a/crates/cargo-add/tests/cmd/add/multiple_conflicts_with_features.toml b/crates/cargo-add/tests/cmd/add/multiple_conflicts_with_features.toml deleted file mode 100644 index e7cf658a36..0000000000 --- a/crates/cargo-add/tests/cmd/add/multiple_conflicts_with_features.toml +++ /dev/null @@ -1,11 +0,0 @@ -bin.name = "cargo-add" -args = ["add", "my-package1", "your-face", "--features", "nose"] -status.code = 1 -stdout = "" -stderr = """ -Error: Cannot specify multiple crates with features -""" -fs.sandbox = true - -[env.add] -CARGO_IS_TEST="1" diff --git a/crates/cargo-add/tests/cmd/add/multiple_conflicts_with_git.out/Cargo.toml b/crates/cargo-add/tests/cmd/add/multiple_conflicts_with_git.out/Cargo.toml deleted file mode 100644 index 5e20016d71..0000000000 --- a/crates/cargo-add/tests/cmd/add/multiple_conflicts_with_git.out/Cargo.toml +++ /dev/null @@ -1,3 +0,0 @@ -[package] -name = "cargo-list-test-fixture" -version = "0.0.0" diff --git a/crates/cargo-add/tests/cmd/add/multiple_conflicts_with_git.toml b/crates/cargo-add/tests/cmd/add/multiple_conflicts_with_git.toml deleted file mode 100644 index e33978d324..0000000000 --- a/crates/cargo-add/tests/cmd/add/multiple_conflicts_with_git.toml +++ /dev/null @@ -1,11 +0,0 @@ -bin.name = "cargo-add" -args = ["add", "my-package1", "my-package2", "--git", "https://github.com/dcjanus/invalid", "-Zgit"] -status.code = 1 -stdout = "" -stderr = """ -Error: Cannot specify multiple crates with path or git or vers -""" -fs.sandbox = true - -[env.add] -CARGO_IS_TEST="1" diff --git a/crates/cargo-add/tests/cmd/add/multiple_conflicts_with_rename.out/Cargo.toml b/crates/cargo-add/tests/cmd/add/multiple_conflicts_with_rename.out/Cargo.toml deleted file mode 100644 index 5e20016d71..0000000000 --- a/crates/cargo-add/tests/cmd/add/multiple_conflicts_with_rename.out/Cargo.toml +++ /dev/null @@ -1,3 +0,0 @@ -[package] -name = "cargo-list-test-fixture" -version = "0.0.0" diff --git a/crates/cargo-add/tests/cmd/add/multiple_conflicts_with_rename.toml b/crates/cargo-add/tests/cmd/add/multiple_conflicts_with_rename.toml deleted file mode 100644 index eee40cb02e..0000000000 --- a/crates/cargo-add/tests/cmd/add/multiple_conflicts_with_rename.toml +++ /dev/null @@ -1,11 +0,0 @@ -bin.name = "cargo-add" -args = ["add", "my-package1", "my-package2", "--rename", "renamed"] -status.code = 1 -stdout = "" -stderr = """ -Error: Cannot specify multiple crates with rename -""" -fs.sandbox = true - -[env.add] -CARGO_IS_TEST="1" diff --git a/crates/cargo-add/tests/cmd/add/namever.toml b/crates/cargo-add/tests/cmd/add/namever.toml deleted file mode 100644 index 33e611e731..0000000000 --- a/crates/cargo-add/tests/cmd/add/namever.toml +++ /dev/null @@ -1,13 +0,0 @@ -bin.name = "cargo-add" -args = ["add", "my-package1@>=0.1.1", "my-package2@0.2.3", "my-package"] -status = "success" -stdout = "" -stderr = """ - Adding my-package1 >=0.1.1 to dependencies. - Adding my-package2 v0.2.3 to dependencies. - Adding my-package v99999.0.0 to dependencies. -""" -fs.sandbox = true - -[env.add] -CARGO_IS_TEST="1" diff --git a/crates/cargo-add/tests/cmd/add/no_args.out/Cargo.toml b/crates/cargo-add/tests/cmd/add/no_args.out/Cargo.toml deleted file mode 100644 index 5e20016d71..0000000000 --- a/crates/cargo-add/tests/cmd/add/no_args.out/Cargo.toml +++ /dev/null @@ -1,3 +0,0 @@ -[package] -name = "cargo-list-test-fixture" -version = "0.0.0" diff --git a/crates/cargo-add/tests/cmd/add/no_default_features.toml b/crates/cargo-add/tests/cmd/add/no_default_features.toml deleted file mode 100644 index 21ca94f066..0000000000 --- a/crates/cargo-add/tests/cmd/add/no_default_features.toml +++ /dev/null @@ -1,12 +0,0 @@ -bin.name = "cargo-add" -args = ["add", "my-package1", "my-package2@0.4.1", "--no-default-features"] -status = "success" -stdout = "" -stderr = """ - Adding my-package1 v99999.0.0 to dependencies. - Adding my-package2 v0.4.1 to dependencies. -""" -fs.sandbox = true - -[env.add] -CARGO_IS_TEST="1" diff --git a/crates/cargo-add/tests/cmd/add/no_optional.toml b/crates/cargo-add/tests/cmd/add/no_optional.toml deleted file mode 100644 index 594c0956e1..0000000000 --- a/crates/cargo-add/tests/cmd/add/no_optional.toml +++ /dev/null @@ -1,12 +0,0 @@ -bin.name = "cargo-add" -args = ["add", "my-package1", "my-package2@0.4.1", "--no-optional"] -status = "success" -stdout = "" -stderr = """ - Adding my-package1 v99999.0.0 to dependencies. - Adding my-package2 v0.4.1 to dependencies. -""" -fs.sandbox = true - -[env.add] -CARGO_IS_TEST="1" diff --git a/crates/cargo-add/tests/cmd/add/optional.toml b/crates/cargo-add/tests/cmd/add/optional.toml deleted file mode 100644 index 8cdc49f78a..0000000000 --- a/crates/cargo-add/tests/cmd/add/optional.toml +++ /dev/null @@ -1,12 +0,0 @@ -bin.name = "cargo-add" -args = ["add", "my-package1", "my-package2@0.4.1", "--optional"] -status = "success" -stdout = "" -stderr = """ - Adding my-package1 v99999.0.0 to optional dependencies. - Adding my-package2 v0.4.1 to optional dependencies. -""" -fs.sandbox = true - -[env.add] -CARGO_IS_TEST="1" diff --git a/crates/cargo-add/tests/cmd/add/overwrite_default_features.toml b/crates/cargo-add/tests/cmd/add/overwrite_default_features.toml deleted file mode 100644 index e0ac163693..0000000000 --- a/crates/cargo-add/tests/cmd/add/overwrite_default_features.toml +++ /dev/null @@ -1,12 +0,0 @@ -bin.name = "cargo-add" -args = ["add", "my-package1", "my-package2@0.4.1", "--default-features"] -status = "success" -stdout = "" -stderr = """ - Adding my-package1 v99999.0.0 to dependencies. - Adding my-package2 v0.4.1 to dependencies. -""" -fs.sandbox = true - -[env.add] -CARGO_IS_TEST="1" diff --git a/crates/cargo-add/tests/cmd/add/overwrite_default_features_with_no_default_features.toml b/crates/cargo-add/tests/cmd/add/overwrite_default_features_with_no_default_features.toml deleted file mode 100644 index 21ca94f066..0000000000 --- a/crates/cargo-add/tests/cmd/add/overwrite_default_features_with_no_default_features.toml +++ /dev/null @@ -1,12 +0,0 @@ -bin.name = "cargo-add" -args = ["add", "my-package1", "my-package2@0.4.1", "--no-default-features"] -status = "success" -stdout = "" -stderr = """ - Adding my-package1 v99999.0.0 to dependencies. - Adding my-package2 v0.4.1 to dependencies. -""" -fs.sandbox = true - -[env.add] -CARGO_IS_TEST="1" diff --git a/crates/cargo-add/tests/cmd/add/overwrite_features.toml b/crates/cargo-add/tests/cmd/add/overwrite_features.toml deleted file mode 100644 index 824b04817b..0000000000 --- a/crates/cargo-add/tests/cmd/add/overwrite_features.toml +++ /dev/null @@ -1,16 +0,0 @@ -bin.name = "cargo-add" -args = ["add", "your-face", "--features", "nose"] -status = "success" -stdout = "" -stderr = """ - Adding your-face v99999.0.0 to dependencies. - Features: - + eyes - + nose - - ears - - mouth -""" -fs.sandbox = true - -[env.add] -CARGO_IS_TEST="1" diff --git a/crates/cargo-add/tests/cmd/add/overwrite_git_with_inline_path.toml b/crates/cargo-add/tests/cmd/add/overwrite_git_with_inline_path.toml deleted file mode 100644 index be077a7e48..0000000000 --- a/crates/cargo-add/tests/cmd/add/overwrite_git_with_inline_path.toml +++ /dev/null @@ -1,12 +0,0 @@ -bin.name = "cargo-add" -args = ["add", "../dependency"] -status = "success" -stdout = "" -stderr = """ - Adding cargo-list-test-fixture-dependency (local) to optional dependencies. -""" -fs.sandbox = true -fs.cwd = "overwrite_git_with_inline_path.in/primary" - -[env.add] -CARGO_IS_TEST="1" diff --git a/crates/cargo-add/tests/cmd/add/overwrite_inline_features.in/Cargo.toml b/crates/cargo-add/tests/cmd/add/overwrite_inline_features.in/Cargo.toml deleted file mode 100644 index a866d74a7a..0000000000 --- a/crates/cargo-add/tests/cmd/add/overwrite_inline_features.in/Cargo.toml +++ /dev/null @@ -1,6 +0,0 @@ -[package] -name = "cargo-list-test-fixture" -version = "0.0.0" - -[dependencies] -your-face = { version = "99999.0.0", features = ["eyes"] } diff --git a/crates/cargo-add/tests/cmd/add/overwrite_name_dev_noop.in/.cargo/config b/crates/cargo-add/tests/cmd/add/overwrite_name_dev_noop.in/.cargo/config deleted file mode 100644 index feb02f3c12..0000000000 --- a/crates/cargo-add/tests/cmd/add/overwrite_name_dev_noop.in/.cargo/config +++ /dev/null @@ -1,2 +0,0 @@ -[registries.alternative] -index = "https://github.com/ordian/crates.io-index" diff --git a/crates/cargo-add/tests/cmd/add/overwrite_name_dev_noop.toml b/crates/cargo-add/tests/cmd/add/overwrite_name_dev_noop.toml deleted file mode 100644 index fa81c2ef44..0000000000 --- a/crates/cargo-add/tests/cmd/add/overwrite_name_dev_noop.toml +++ /dev/null @@ -1,15 +0,0 @@ -bin.name = "cargo-add" -args = ["add", "cargo-list-test-fixture-dependency", "--dev"] -status = "success" -stdout = "" -stderr = """ -warning: Unrecognized features: [\"one\", \"two\"] - Adding cargo-list-test-fixture-dependency (local) to dev-dependencies. - Features: - + one - + two -""" -fs.sandbox = true - -[env.add] -CARGO_IS_TEST="1" diff --git a/crates/cargo-add/tests/cmd/add/overwrite_name_noop.in/.cargo/config b/crates/cargo-add/tests/cmd/add/overwrite_name_noop.in/.cargo/config deleted file mode 100644 index feb02f3c12..0000000000 --- a/crates/cargo-add/tests/cmd/add/overwrite_name_noop.in/.cargo/config +++ /dev/null @@ -1,2 +0,0 @@ -[registries.alternative] -index = "https://github.com/ordian/crates.io-index" diff --git a/crates/cargo-add/tests/cmd/add/overwrite_name_noop.toml b/crates/cargo-add/tests/cmd/add/overwrite_name_noop.toml deleted file mode 100644 index e61681ad92..0000000000 --- a/crates/cargo-add/tests/cmd/add/overwrite_name_noop.toml +++ /dev/null @@ -1,15 +0,0 @@ -bin.name = "cargo-add" -args = ["add", "cargo-list-test-fixture-dependency"] -status = "success" -stdout = "" -stderr = """ -warning: Unrecognized features: [\"one\", \"two\"] - Adding cargo-list-test-fixture-dependency (local) to optional dependencies. - Features: - + one - + two -""" -fs.sandbox = true - -[env.add] -CARGO_IS_TEST="1" diff --git a/crates/cargo-add/tests/cmd/add/overwrite_no_default_features.in/Cargo.toml b/crates/cargo-add/tests/cmd/add/overwrite_no_default_features.in/Cargo.toml deleted file mode 100644 index 669085becf..0000000000 --- a/crates/cargo-add/tests/cmd/add/overwrite_no_default_features.in/Cargo.toml +++ /dev/null @@ -1,7 +0,0 @@ -[package] -name = "cargo-list-test-fixture" -version = "0.0.0" - -[dependencies] -my-package1 = "99999.0.0" -my-package2 = "0.4.1" diff --git a/crates/cargo-add/tests/cmd/add/overwrite_no_default_features.toml b/crates/cargo-add/tests/cmd/add/overwrite_no_default_features.toml deleted file mode 100644 index 21ca94f066..0000000000 --- a/crates/cargo-add/tests/cmd/add/overwrite_no_default_features.toml +++ /dev/null @@ -1,12 +0,0 @@ -bin.name = "cargo-add" -args = ["add", "my-package1", "my-package2@0.4.1", "--no-default-features"] -status = "success" -stdout = "" -stderr = """ - Adding my-package1 v99999.0.0 to dependencies. - Adding my-package2 v0.4.1 to dependencies. -""" -fs.sandbox = true - -[env.add] -CARGO_IS_TEST="1" diff --git a/crates/cargo-add/tests/cmd/add/overwrite_no_default_features_with_default_features.toml b/crates/cargo-add/tests/cmd/add/overwrite_no_default_features_with_default_features.toml deleted file mode 100644 index e0ac163693..0000000000 --- a/crates/cargo-add/tests/cmd/add/overwrite_no_default_features_with_default_features.toml +++ /dev/null @@ -1,12 +0,0 @@ -bin.name = "cargo-add" -args = ["add", "my-package1", "my-package2@0.4.1", "--default-features"] -status = "success" -stdout = "" -stderr = """ - Adding my-package1 v99999.0.0 to dependencies. - Adding my-package2 v0.4.1 to dependencies. -""" -fs.sandbox = true - -[env.add] -CARGO_IS_TEST="1" diff --git a/crates/cargo-add/tests/cmd/add/overwrite_no_optional.in/Cargo.toml b/crates/cargo-add/tests/cmd/add/overwrite_no_optional.in/Cargo.toml deleted file mode 100644 index 669085becf..0000000000 --- a/crates/cargo-add/tests/cmd/add/overwrite_no_optional.in/Cargo.toml +++ /dev/null @@ -1,7 +0,0 @@ -[package] -name = "cargo-list-test-fixture" -version = "0.0.0" - -[dependencies] -my-package1 = "99999.0.0" -my-package2 = "0.4.1" diff --git a/crates/cargo-add/tests/cmd/add/overwrite_no_optional.out/Cargo.toml b/crates/cargo-add/tests/cmd/add/overwrite_no_optional.out/Cargo.toml deleted file mode 100644 index 669085becf..0000000000 --- a/crates/cargo-add/tests/cmd/add/overwrite_no_optional.out/Cargo.toml +++ /dev/null @@ -1,7 +0,0 @@ -[package] -name = "cargo-list-test-fixture" -version = "0.0.0" - -[dependencies] -my-package1 = "99999.0.0" -my-package2 = "0.4.1" diff --git a/crates/cargo-add/tests/cmd/add/overwrite_no_optional.toml b/crates/cargo-add/tests/cmd/add/overwrite_no_optional.toml deleted file mode 100644 index 594c0956e1..0000000000 --- a/crates/cargo-add/tests/cmd/add/overwrite_no_optional.toml +++ /dev/null @@ -1,12 +0,0 @@ -bin.name = "cargo-add" -args = ["add", "my-package1", "my-package2@0.4.1", "--no-optional"] -status = "success" -stdout = "" -stderr = """ - Adding my-package1 v99999.0.0 to dependencies. - Adding my-package2 v0.4.1 to dependencies. -""" -fs.sandbox = true - -[env.add] -CARGO_IS_TEST="1" diff --git a/crates/cargo-add/tests/cmd/add/overwrite_no_optional_with_optional.toml b/crates/cargo-add/tests/cmd/add/overwrite_no_optional_with_optional.toml deleted file mode 100644 index 8cdc49f78a..0000000000 --- a/crates/cargo-add/tests/cmd/add/overwrite_no_optional_with_optional.toml +++ /dev/null @@ -1,12 +0,0 @@ -bin.name = "cargo-add" -args = ["add", "my-package1", "my-package2@0.4.1", "--optional"] -status = "success" -stdout = "" -stderr = """ - Adding my-package1 v99999.0.0 to optional dependencies. - Adding my-package2 v0.4.1 to optional dependencies. -""" -fs.sandbox = true - -[env.add] -CARGO_IS_TEST="1" diff --git a/crates/cargo-add/tests/cmd/add/overwrite_optional.in/Cargo.toml b/crates/cargo-add/tests/cmd/add/overwrite_optional.in/Cargo.toml deleted file mode 100644 index 669085becf..0000000000 --- a/crates/cargo-add/tests/cmd/add/overwrite_optional.in/Cargo.toml +++ /dev/null @@ -1,7 +0,0 @@ -[package] -name = "cargo-list-test-fixture" -version = "0.0.0" - -[dependencies] -my-package1 = "99999.0.0" -my-package2 = "0.4.1" diff --git a/crates/cargo-add/tests/cmd/add/overwrite_optional.toml b/crates/cargo-add/tests/cmd/add/overwrite_optional.toml deleted file mode 100644 index 8cdc49f78a..0000000000 --- a/crates/cargo-add/tests/cmd/add/overwrite_optional.toml +++ /dev/null @@ -1,12 +0,0 @@ -bin.name = "cargo-add" -args = ["add", "my-package1", "my-package2@0.4.1", "--optional"] -status = "success" -stdout = "" -stderr = """ - Adding my-package1 v99999.0.0 to optional dependencies. - Adding my-package2 v0.4.1 to optional dependencies. -""" -fs.sandbox = true - -[env.add] -CARGO_IS_TEST="1" diff --git a/crates/cargo-add/tests/cmd/add/overwrite_optional_with_no_optional.toml b/crates/cargo-add/tests/cmd/add/overwrite_optional_with_no_optional.toml deleted file mode 100644 index 594c0956e1..0000000000 --- a/crates/cargo-add/tests/cmd/add/overwrite_optional_with_no_optional.toml +++ /dev/null @@ -1,12 +0,0 @@ -bin.name = "cargo-add" -args = ["add", "my-package1", "my-package2@0.4.1", "--no-optional"] -status = "success" -stdout = "" -stderr = """ - Adding my-package1 v99999.0.0 to dependencies. - Adding my-package2 v0.4.1 to dependencies. -""" -fs.sandbox = true - -[env.add] -CARGO_IS_TEST="1" diff --git a/crates/cargo-add/tests/cmd/add/overwrite_path_noop.in/.cargo/config b/crates/cargo-add/tests/cmd/add/overwrite_path_noop.in/.cargo/config deleted file mode 100644 index feb02f3c12..0000000000 --- a/crates/cargo-add/tests/cmd/add/overwrite_path_noop.in/.cargo/config +++ /dev/null @@ -1,2 +0,0 @@ -[registries.alternative] -index = "https://github.com/ordian/crates.io-index" diff --git a/crates/cargo-add/tests/cmd/add/overwrite_path_noop.in/Cargo.toml b/crates/cargo-add/tests/cmd/add/overwrite_path_noop.in/Cargo.toml deleted file mode 100644 index 51f8875b54..0000000000 --- a/crates/cargo-add/tests/cmd/add/overwrite_path_noop.in/Cargo.toml +++ /dev/null @@ -1,6 +0,0 @@ -[package] -name = "cargo-list-test-fixture" -version = "0.0.0" - -[dependencies] -cargo-list-test-fixture-dependency = { version = "0.0.0", path = "dependency", optional = true, default-features = false, features = ["one", "two"], registry = "alternative" } diff --git a/crates/cargo-add/tests/cmd/add/overwrite_path_noop.out/Cargo.toml b/crates/cargo-add/tests/cmd/add/overwrite_path_noop.out/Cargo.toml deleted file mode 100644 index 51f8875b54..0000000000 --- a/crates/cargo-add/tests/cmd/add/overwrite_path_noop.out/Cargo.toml +++ /dev/null @@ -1,6 +0,0 @@ -[package] -name = "cargo-list-test-fixture" -version = "0.0.0" - -[dependencies] -cargo-list-test-fixture-dependency = { version = "0.0.0", path = "dependency", optional = true, default-features = false, features = ["one", "two"], registry = "alternative" } diff --git a/crates/cargo-add/tests/cmd/add/overwrite_path_noop.toml b/crates/cargo-add/tests/cmd/add/overwrite_path_noop.toml deleted file mode 100644 index 0df5d9731c..0000000000 --- a/crates/cargo-add/tests/cmd/add/overwrite_path_noop.toml +++ /dev/null @@ -1,15 +0,0 @@ -bin.name = "cargo-add" -args = ["add", "./dependency"] -status = "success" -stdout = "" -stderr = """ -warning: Unrecognized features: [\"one\", \"two\"] - Adding cargo-list-test-fixture-dependency (local) to optional dependencies. - Features: - + one - + two -""" -fs.sandbox = true - -[env.add] -CARGO_IS_TEST="1" diff --git a/crates/cargo-add/tests/cmd/add/overwrite_path_with_version.toml b/crates/cargo-add/tests/cmd/add/overwrite_path_with_version.toml deleted file mode 100644 index 51d2c38cd3..0000000000 --- a/crates/cargo-add/tests/cmd/add/overwrite_path_with_version.toml +++ /dev/null @@ -1,12 +0,0 @@ -bin.name = "cargo-add" -args = ["add", "cargo-list-test-fixture-dependency@20.0"] -status = "success" -stdout = "" -stderr = """ - Adding cargo-list-test-fixture-dependency v20.0 to optional dependencies. -""" -fs.sandbox = true -fs.cwd = "overwrite_path_with_version.in/primary" - -[env.add] -CARGO_IS_TEST="1" diff --git a/crates/cargo-add/tests/cmd/add/overwrite_rename_with_no_rename.toml b/crates/cargo-add/tests/cmd/add/overwrite_rename_with_no_rename.toml deleted file mode 100644 index 4ca8662976..0000000000 --- a/crates/cargo-add/tests/cmd/add/overwrite_rename_with_no_rename.toml +++ /dev/null @@ -1,11 +0,0 @@ -bin.name = "cargo-add" -args = ["add", "versioned-package"] -status = "success" -stdout = "" -stderr = """ - Adding versioned-package v99999.0.0 to dependencies. -""" -fs.sandbox = true - -[env.add] -CARGO_IS_TEST="1" diff --git a/crates/cargo-add/tests/cmd/add/overwrite_rename_with_rename.toml b/crates/cargo-add/tests/cmd/add/overwrite_rename_with_rename.toml deleted file mode 100644 index 80ff9ffc65..0000000000 --- a/crates/cargo-add/tests/cmd/add/overwrite_rename_with_rename.toml +++ /dev/null @@ -1,11 +0,0 @@ -bin.name = "cargo-add" -args = ["add", "versioned-package", "--rename", "a2"] -status = "success" -stdout = "" -stderr = """ - Adding versioned-package v99999.0.0 to dependencies. -""" -fs.sandbox = true - -[env.add] -CARGO_IS_TEST="1" diff --git a/crates/cargo-add/tests/cmd/add/overwrite_rename_with_rename_noop.toml b/crates/cargo-add/tests/cmd/add/overwrite_rename_with_rename_noop.toml deleted file mode 100644 index 73e96ea5f0..0000000000 --- a/crates/cargo-add/tests/cmd/add/overwrite_rename_with_rename_noop.toml +++ /dev/null @@ -1,11 +0,0 @@ -bin.name = "cargo-add" -args = ["add", "versioned-package", "--rename", "a1"] -status = "success" -stdout = "" -stderr = """ - Adding versioned-package v0.1.1 to optional dependencies. -""" -fs.sandbox = true - -[env.add] -CARGO_IS_TEST="1" diff --git a/crates/cargo-add/tests/cmd/add/overwrite_version_with_git.toml b/crates/cargo-add/tests/cmd/add/overwrite_version_with_git.toml deleted file mode 100644 index 54aa1ea452..0000000000 --- a/crates/cargo-add/tests/cmd/add/overwrite_version_with_git.toml +++ /dev/null @@ -1,11 +0,0 @@ -bin.name = "cargo-add" -args = ["add", "versioned-package", "--git", "git://git.git", "-Zgit"] -status = "success" -stdout = "" -stderr = """ - Adding versioned-package (git) to optional dependencies. -""" -fs.sandbox = true - -[env.add] -CARGO_IS_TEST="1" diff --git a/crates/cargo-add/tests/cmd/add/overwrite_version_with_inline_path.toml b/crates/cargo-add/tests/cmd/add/overwrite_version_with_inline_path.toml deleted file mode 100644 index 184d2cbfac..0000000000 --- a/crates/cargo-add/tests/cmd/add/overwrite_version_with_inline_path.toml +++ /dev/null @@ -1,12 +0,0 @@ -bin.name = "cargo-add" -args = ["add", "../dependency"] -status = "success" -stdout = "" -stderr = """ - Adding cargo-list-test-fixture-dependency (local) to optional dependencies. -""" -fs.sandbox = true -fs.cwd = "overwrite_version_with_inline_path.in/primary" - -[env.add] -CARGO_IS_TEST="1" diff --git a/crates/cargo-add/tests/cmd/add/overwrite_with_rename.toml b/crates/cargo-add/tests/cmd/add/overwrite_with_rename.toml deleted file mode 100644 index bde2156937..0000000000 --- a/crates/cargo-add/tests/cmd/add/overwrite_with_rename.toml +++ /dev/null @@ -1,11 +0,0 @@ -bin.name = "cargo-add" -args = ["add", "versioned-package", "--rename", "renamed"] -status = "success" -stdout = "" -stderr = """ - Adding versioned-package v99999.0.0 to dependencies. -""" -fs.sandbox = true - -[env.add] -CARGO_IS_TEST="1" diff --git a/crates/cargo-add/tests/cmd/add/preserve_sorted.toml b/crates/cargo-add/tests/cmd/add/preserve_sorted.toml deleted file mode 100644 index 9919b3589b..0000000000 --- a/crates/cargo-add/tests/cmd/add/preserve_sorted.toml +++ /dev/null @@ -1,11 +0,0 @@ -bin.name = "cargo-add" -args = ["add", "toml"] -status = "success" -stdout = "" -stderr = """ - Adding toml v99999.0.0 to dependencies. -""" -fs.sandbox = true - -[env.add] -CARGO_IS_TEST="1" diff --git a/crates/cargo-add/tests/cmd/add/preserve_unsorted.toml b/crates/cargo-add/tests/cmd/add/preserve_unsorted.toml deleted file mode 100644 index 9919b3589b..0000000000 --- a/crates/cargo-add/tests/cmd/add/preserve_unsorted.toml +++ /dev/null @@ -1,11 +0,0 @@ -bin.name = "cargo-add" -args = ["add", "toml"] -status = "success" -stdout = "" -stderr = """ - Adding toml v99999.0.0 to dependencies. -""" -fs.sandbox = true - -[env.add] -CARGO_IS_TEST="1" diff --git a/crates/cargo-add/tests/cmd/add/registry.in/.cargo/config b/crates/cargo-add/tests/cmd/add/registry.in/.cargo/config deleted file mode 100644 index feb02f3c12..0000000000 --- a/crates/cargo-add/tests/cmd/add/registry.in/.cargo/config +++ /dev/null @@ -1,2 +0,0 @@ -[registries.alternative] -index = "https://github.com/ordian/crates.io-index" diff --git a/crates/cargo-add/tests/cmd/add/registry.in/Cargo.toml b/crates/cargo-add/tests/cmd/add/registry.in/Cargo.toml deleted file mode 100644 index 5e20016d71..0000000000 --- a/crates/cargo-add/tests/cmd/add/registry.in/Cargo.toml +++ /dev/null @@ -1,3 +0,0 @@ -[package] -name = "cargo-list-test-fixture" -version = "0.0.0" diff --git a/crates/cargo-add/tests/cmd/add/registry.toml b/crates/cargo-add/tests/cmd/add/registry.toml deleted file mode 100644 index 434416d036..0000000000 --- a/crates/cargo-add/tests/cmd/add/registry.toml +++ /dev/null @@ -1,12 +0,0 @@ -bin.name = "cargo-add" -args = ["add", "my-package1", "my-package2", "--registry", "alternative"] -status = "success" -stdout = "" -stderr = """ - Adding my-package1 v99999.0.0 to dependencies. - Adding my-package2 v99999.0.0 to dependencies. -""" -fs.sandbox = true - -[env.add] -CARGO_IS_TEST="1" diff --git a/crates/cargo-add/tests/cmd/add/rename.toml b/crates/cargo-add/tests/cmd/add/rename.toml deleted file mode 100644 index 9f30e09fd9..0000000000 --- a/crates/cargo-add/tests/cmd/add/rename.toml +++ /dev/null @@ -1,11 +0,0 @@ -bin.name = "cargo-add" -args = ["add", "my-package", "--rename", "renamed"] -status = "success" -stdout = "" -stderr = """ - Adding my-package v99999.0.0 to dependencies. -""" -fs.sandbox = true - -[env.add] -CARGO_IS_TEST="1" diff --git a/crates/cargo-add/tests/cmd/add/target.toml b/crates/cargo-add/tests/cmd/add/target.toml deleted file mode 100644 index 783bd89ee8..0000000000 --- a/crates/cargo-add/tests/cmd/add/target.toml +++ /dev/null @@ -1,12 +0,0 @@ -bin.name = "cargo-add" -args = ["add", "my-package1", "my-package2", "--target", "i686-unknown-linux-gnu"] -status = "success" -stdout = "" -stderr = """ - Adding my-package1 v99999.0.0 to dependencies for target `i686-unknown-linux-gnu`. - Adding my-package2 v99999.0.0 to dependencies for target `i686-unknown-linux-gnu`. -""" -fs.sandbox = true - -[env.add] -CARGO_IS_TEST="1" diff --git a/crates/cargo-add/tests/cmd/add/target_cfg.toml b/crates/cargo-add/tests/cmd/add/target_cfg.toml deleted file mode 100644 index c671258ecc..0000000000 --- a/crates/cargo-add/tests/cmd/add/target_cfg.toml +++ /dev/null @@ -1,12 +0,0 @@ -bin.name = "cargo-add" -args = ["add", "my-package1", "my-package2", "--target", "cfg(unix)"] -status = "success" -stdout = "" -stderr = """ - Adding my-package1 v99999.0.0 to dependencies for target `cfg(unix)`. - Adding my-package2 v99999.0.0 to dependencies for target `cfg(unix)`. -""" -fs.sandbox = true - -[env.add] -CARGO_IS_TEST="1" diff --git a/crates/cargo-add/tests/cmd/add/vers.toml b/crates/cargo-add/tests/cmd/add/vers.toml deleted file mode 100644 index 63a1642b1c..0000000000 --- a/crates/cargo-add/tests/cmd/add/vers.toml +++ /dev/null @@ -1,11 +0,0 @@ -bin.name = "cargo-add" -args = ["add", "my-package@>=0.1.1"] -status = "success" -stdout = "" -stderr = """ - Adding my-package >=0.1.1 to dependencies. -""" -fs.sandbox = true - -[env.add] -CARGO_IS_TEST="1" diff --git a/crates/cargo-add/tests/cmd/add/workspace_inline_path.in/primary/Cargo.toml b/crates/cargo-add/tests/cmd/add/workspace_inline_path.in/primary/Cargo.toml deleted file mode 100644 index 5e20016d71..0000000000 --- a/crates/cargo-add/tests/cmd/add/workspace_inline_path.in/primary/Cargo.toml +++ /dev/null @@ -1,3 +0,0 @@ -[package] -name = "cargo-list-test-fixture" -version = "0.0.0" diff --git a/crates/cargo-add/tests/cmd/add/workspace_inline_path.toml b/crates/cargo-add/tests/cmd/add/workspace_inline_path.toml deleted file mode 100644 index d254dd1b9d..0000000000 --- a/crates/cargo-add/tests/cmd/add/workspace_inline_path.toml +++ /dev/null @@ -1,12 +0,0 @@ -bin.name = "cargo-add" -args = ["add", "../dependency"] -status = "success" -stdout = "" -stderr = """ - Adding cargo-list-test-fixture-dependency (local) to dependencies. -""" -fs.sandbox = true -fs.cwd = "workspace_inline_path.in/primary" - -[env.add] -CARGO_IS_TEST="1" diff --git a/crates/cargo-add/tests/cmd/add/workspace_inline_path_dev.in/primary/Cargo.toml b/crates/cargo-add/tests/cmd/add/workspace_inline_path_dev.in/primary/Cargo.toml deleted file mode 100644 index 5e20016d71..0000000000 --- a/crates/cargo-add/tests/cmd/add/workspace_inline_path_dev.in/primary/Cargo.toml +++ /dev/null @@ -1,3 +0,0 @@ -[package] -name = "cargo-list-test-fixture" -version = "0.0.0" diff --git a/crates/cargo-add/tests/cmd/add/workspace_inline_path_dev.toml b/crates/cargo-add/tests/cmd/add/workspace_inline_path_dev.toml deleted file mode 100644 index f00d69d20e..0000000000 --- a/crates/cargo-add/tests/cmd/add/workspace_inline_path_dev.toml +++ /dev/null @@ -1,12 +0,0 @@ -bin.name = "cargo-add" -args = ["add", "../dependency", "--dev"] -status = "success" -stdout = "" -stderr = """ - Adding cargo-list-test-fixture-dependency (local) to dev-dependencies. -""" -fs.sandbox = true -fs.cwd = "workspace_inline_path_dev.in/primary" - -[env.add] -CARGO_IS_TEST="1" diff --git a/crates/cargo-add/tests/cmd/add/workspace_name.in/primary/Cargo.toml b/crates/cargo-add/tests/cmd/add/workspace_name.in/primary/Cargo.toml deleted file mode 100644 index 5e20016d71..0000000000 --- a/crates/cargo-add/tests/cmd/add/workspace_name.in/primary/Cargo.toml +++ /dev/null @@ -1,3 +0,0 @@ -[package] -name = "cargo-list-test-fixture" -version = "0.0.0" diff --git a/crates/cargo-add/tests/cmd/add/workspace_name.toml b/crates/cargo-add/tests/cmd/add/workspace_name.toml deleted file mode 100644 index cd9767293f..0000000000 --- a/crates/cargo-add/tests/cmd/add/workspace_name.toml +++ /dev/null @@ -1,12 +0,0 @@ -bin.name = "cargo-add" -args = ["add", "cargo-list-test-fixture-dependency"] -status = "success" -stdout = "" -stderr = """ - Adding cargo-list-test-fixture-dependency (local) to dependencies. -""" -fs.sandbox = true -fs.cwd = "workspace_name.in/primary" - -[env.add] -CARGO_IS_TEST="1" diff --git a/crates/cargo-add/tests/cmd/add/inline_path.in/primary/Cargo.toml b/crates/cargo-add/tests/snapshots/add/add-basic.in/Cargo.toml similarity index 100% rename from crates/cargo-add/tests/cmd/add/inline_path.in/primary/Cargo.toml rename to crates/cargo-add/tests/snapshots/add/add-basic.in/Cargo.toml diff --git a/crates/cargo-add/tests/cmd/add/add-basic.in/src/lib.rs b/crates/cargo-add/tests/snapshots/add/add-basic.in/src/lib.rs similarity index 100% rename from crates/cargo-add/tests/cmd/add/add-basic.in/src/lib.rs rename to crates/cargo-add/tests/snapshots/add/add-basic.in/src/lib.rs diff --git a/crates/cargo-add/tests/cmd/add/add_basic.in b/crates/cargo-add/tests/snapshots/add/add_basic.in similarity index 100% rename from crates/cargo-add/tests/cmd/add/add_basic.in rename to crates/cargo-add/tests/snapshots/add/add_basic.in diff --git a/crates/cargo-add/tests/cmd/add/add_basic.out/Cargo.toml b/crates/cargo-add/tests/snapshots/add/add_basic.out/Cargo.toml similarity index 88% rename from crates/cargo-add/tests/cmd/add/add_basic.out/Cargo.toml rename to crates/cargo-add/tests/snapshots/add/add_basic.out/Cargo.toml index 5e2ebf198a..5964c87be7 100644 --- a/crates/cargo-add/tests/cmd/add/add_basic.out/Cargo.toml +++ b/crates/cargo-add/tests/snapshots/add/add_basic.out/Cargo.toml @@ -1,3 +1,5 @@ +[workspace] + [package] name = "cargo-list-test-fixture" version = "0.0.0" diff --git a/crates/cargo-add/tests/snapshots/add/add_basic.stderr b/crates/cargo-add/tests/snapshots/add/add_basic.stderr new file mode 100644 index 0000000000..ac08493cd5 --- /dev/null +++ b/crates/cargo-add/tests/snapshots/add/add_basic.stderr @@ -0,0 +1,2 @@ + Updating '[ROOTURL]/registry' index + Adding my-package v99999.0.0 to dependencies. diff --git a/crates/cargo-add/tests/cmd/add/build_prefer_existing_version.in/dependency/src/lib.rs b/crates/cargo-add/tests/snapshots/add/add_basic.stdout similarity index 100% rename from crates/cargo-add/tests/cmd/add/build_prefer_existing_version.in/dependency/src/lib.rs rename to crates/cargo-add/tests/snapshots/add/add_basic.stdout diff --git a/crates/cargo-add/tests/cmd/add/add_multiple.in b/crates/cargo-add/tests/snapshots/add/add_multiple.in similarity index 100% rename from crates/cargo-add/tests/cmd/add/add_multiple.in rename to crates/cargo-add/tests/snapshots/add/add_multiple.in diff --git a/crates/cargo-add/tests/cmd/add/add_multiple.out/Cargo.toml b/crates/cargo-add/tests/snapshots/add/add_multiple.out/Cargo.toml similarity index 90% rename from crates/cargo-add/tests/cmd/add/add_multiple.out/Cargo.toml rename to crates/cargo-add/tests/snapshots/add/add_multiple.out/Cargo.toml index 308d388587..ba8d7eabe5 100644 --- a/crates/cargo-add/tests/cmd/add/add_multiple.out/Cargo.toml +++ b/crates/cargo-add/tests/snapshots/add/add_multiple.out/Cargo.toml @@ -1,3 +1,5 @@ +[workspace] + [package] name = "cargo-list-test-fixture" version = "0.0.0" diff --git a/crates/cargo-add/tests/snapshots/add/add_multiple.stderr b/crates/cargo-add/tests/snapshots/add/add_multiple.stderr new file mode 100644 index 0000000000..17bd2fdc89 --- /dev/null +++ b/crates/cargo-add/tests/snapshots/add/add_multiple.stderr @@ -0,0 +1,3 @@ + Updating '[ROOTURL]/registry' index + Adding my-package1 v99999.0.0 to dependencies. + Adding my-package2 v99999.0.0 to dependencies. diff --git a/crates/cargo-add/tests/cmd/add/build_prefer_existing_version.in/src/lib.rs b/crates/cargo-add/tests/snapshots/add/add_multiple.stdout similarity index 100% rename from crates/cargo-add/tests/cmd/add/build_prefer_existing_version.in/src/lib.rs rename to crates/cargo-add/tests/snapshots/add/add_multiple.stdout diff --git a/crates/cargo-add/tests/cmd/add/add_normalized_name_external.in b/crates/cargo-add/tests/snapshots/add/add_normalized_name_external.in similarity index 100% rename from crates/cargo-add/tests/cmd/add/add_normalized_name_external.in rename to crates/cargo-add/tests/snapshots/add/add_normalized_name_external.in diff --git a/crates/cargo-add/tests/cmd/add/add_normalized_name_external.out/Cargo.toml b/crates/cargo-add/tests/snapshots/add/add_normalized_name_external.out/Cargo.toml similarity index 75% rename from crates/cargo-add/tests/cmd/add/add_normalized_name_external.out/Cargo.toml rename to crates/cargo-add/tests/snapshots/add/add_normalized_name_external.out/Cargo.toml index b418c31c03..3d0dec3434 100644 --- a/crates/cargo-add/tests/cmd/add/add_normalized_name_external.out/Cargo.toml +++ b/crates/cargo-add/tests/snapshots/add/add_normalized_name_external.out/Cargo.toml @@ -1,7 +1,9 @@ +[workspace] + [package] name = "cargo-list-test-fixture" version = "0.0.0" [dependencies] -Inflector = "0.11.4" +inflector = "0.11.4" linked-hash-map = "0.5.4" diff --git a/crates/cargo-add/tests/cmd/add/add_normalized_name_external.toml b/crates/cargo-add/tests/snapshots/add/add_normalized_name_external.stderr similarity index 63% rename from crates/cargo-add/tests/cmd/add/add_normalized_name_external.toml rename to crates/cargo-add/tests/snapshots/add/add_normalized_name_external.stderr index d2fa76cb61..55c7d31302 100644 --- a/crates/cargo-add/tests/cmd/add/add_normalized_name_external.toml +++ b/crates/cargo-add/tests/snapshots/add/add_normalized_name_external.stderr @@ -1,10 +1,6 @@ -bin.name = "cargo-add" -args = ["add", "linked_hash_map", "Inflector"] -status = "success" -stdout = "" -stderr = """ - Updating 'https://github.com/rust-lang/crates.io-index' index + Updating '[ROOTURL]/registry' index WARN: Added `linked-hash-map` instead of `linked_hash_map` +WARN: Added `inflector` instead of `Inflector` Adding linked-hash-map v0.5.4 to dependencies. Features: - clippy @@ -14,11 +10,9 @@ WARN: Added `linked-hash-map` instead of `linked_hash_map` - serde - serde_impl - serde_test - Adding Inflector v0.11.4 to dependencies. + Adding inflector v0.11.4 to dependencies. Features: + heavyweight + lazy_static + regex - unstable -""" -fs.sandbox = true diff --git a/crates/cargo-add/tests/cmd/add/cargo_config_source_empty.in/src/lib.rs b/crates/cargo-add/tests/snapshots/add/add_normalized_name_external.stdout similarity index 100% rename from crates/cargo-add/tests/cmd/add/cargo_config_source_empty.in/src/lib.rs rename to crates/cargo-add/tests/snapshots/add/add_normalized_name_external.stdout diff --git a/crates/cargo-add/tests/cmd/add/build.in b/crates/cargo-add/tests/snapshots/add/build.in similarity index 100% rename from crates/cargo-add/tests/cmd/add/build.in rename to crates/cargo-add/tests/snapshots/add/build.in diff --git a/crates/cargo-add/tests/cmd/add/build.out/Cargo.toml b/crates/cargo-add/tests/snapshots/add/build.out/Cargo.toml similarity index 91% rename from crates/cargo-add/tests/cmd/add/build.out/Cargo.toml rename to crates/cargo-add/tests/snapshots/add/build.out/Cargo.toml index f3c5b1c914..cceb448ed5 100644 --- a/crates/cargo-add/tests/cmd/add/build.out/Cargo.toml +++ b/crates/cargo-add/tests/snapshots/add/build.out/Cargo.toml @@ -1,3 +1,5 @@ +[workspace] + [package] name = "cargo-list-test-fixture" version = "0.0.0" diff --git a/crates/cargo-add/tests/snapshots/add/build.stderr b/crates/cargo-add/tests/snapshots/add/build.stderr new file mode 100644 index 0000000000..2bec981c8d --- /dev/null +++ b/crates/cargo-add/tests/snapshots/add/build.stderr @@ -0,0 +1,3 @@ + Updating '[ROOTURL]/registry' index + Adding my-build-package1 v99999.0.0 to build-dependencies. + Adding my-build-package2 v99999.0.0 to build-dependencies. diff --git a/crates/cargo-add/tests/cmd/add/dev_prefer_existing_version.in/dependency/src/lib.rs b/crates/cargo-add/tests/snapshots/add/build.stdout similarity index 100% rename from crates/cargo-add/tests/cmd/add/dev_prefer_existing_version.in/dependency/src/lib.rs rename to crates/cargo-add/tests/snapshots/add/build.stdout diff --git a/crates/cargo-add/tests/cmd/add/overwrite_name_noop.out/Cargo.toml b/crates/cargo-add/tests/snapshots/add/build_prefer_existing_version.in/Cargo.toml similarity index 86% rename from crates/cargo-add/tests/cmd/add/overwrite_name_noop.out/Cargo.toml rename to crates/cargo-add/tests/snapshots/add/build_prefer_existing_version.in/Cargo.toml index 51f8875b54..6a6ac823fd 100644 --- a/crates/cargo-add/tests/cmd/add/overwrite_name_noop.out/Cargo.toml +++ b/crates/cargo-add/tests/snapshots/add/build_prefer_existing_version.in/Cargo.toml @@ -1,3 +1,6 @@ +[workspace] +exclude = ["dependency"] + [package] name = "cargo-list-test-fixture" version = "0.0.0" diff --git a/crates/cargo-add/tests/cmd/add/build_prefer_existing_version.in/dependency/Cargo.toml b/crates/cargo-add/tests/snapshots/add/build_prefer_existing_version.in/dependency/Cargo.toml similarity index 100% rename from crates/cargo-add/tests/cmd/add/build_prefer_existing_version.in/dependency/Cargo.toml rename to crates/cargo-add/tests/snapshots/add/build_prefer_existing_version.in/dependency/Cargo.toml diff --git a/crates/cargo-add/tests/cmd/add/dev_prefer_existing_version.in/src/lib.rs b/crates/cargo-add/tests/snapshots/add/build_prefer_existing_version.in/dependency/src/lib.rs similarity index 100% rename from crates/cargo-add/tests/cmd/add/dev_prefer_existing_version.in/src/lib.rs rename to crates/cargo-add/tests/snapshots/add/build_prefer_existing_version.in/dependency/src/lib.rs diff --git a/crates/cargo-add/tests/cmd/add/features_preserve.in/src/lib.rs b/crates/cargo-add/tests/snapshots/add/build_prefer_existing_version.in/src/lib.rs similarity index 100% rename from crates/cargo-add/tests/cmd/add/features_preserve.in/src/lib.rs rename to crates/cargo-add/tests/snapshots/add/build_prefer_existing_version.in/src/lib.rs diff --git a/crates/cargo-add/tests/cmd/add/build_prefer_existing_version.out/Cargo.toml b/crates/cargo-add/tests/snapshots/add/build_prefer_existing_version.out/Cargo.toml similarity index 90% rename from crates/cargo-add/tests/cmd/add/build_prefer_existing_version.out/Cargo.toml rename to crates/cargo-add/tests/snapshots/add/build_prefer_existing_version.out/Cargo.toml index d3afa3fcb0..123af6d22a 100644 --- a/crates/cargo-add/tests/cmd/add/build_prefer_existing_version.out/Cargo.toml +++ b/crates/cargo-add/tests/snapshots/add/build_prefer_existing_version.out/Cargo.toml @@ -1,3 +1,6 @@ +[workspace] +exclude = ["dependency"] + [package] name = "cargo-list-test-fixture" version = "0.0.0" diff --git a/crates/cargo-add/tests/cmd/add/build_prefer_existing_version.out/dependency/Cargo.toml b/crates/cargo-add/tests/snapshots/add/build_prefer_existing_version.out/dependency/Cargo.toml similarity index 100% rename from crates/cargo-add/tests/cmd/add/build_prefer_existing_version.out/dependency/Cargo.toml rename to crates/cargo-add/tests/snapshots/add/build_prefer_existing_version.out/dependency/Cargo.toml diff --git a/crates/cargo-add/tests/snapshots/add/build_prefer_existing_version.stderr b/crates/cargo-add/tests/snapshots/add/build_prefer_existing_version.stderr new file mode 100644 index 0000000000..64581f8827 --- /dev/null +++ b/crates/cargo-add/tests/snapshots/add/build_prefer_existing_version.stderr @@ -0,0 +1,2 @@ + Updating '[ROOTURL]/registry' index + Adding cargo-list-test-fixture-dependency (local) to build-dependencies. diff --git a/crates/cargo-add/tests/cmd/add/inline_path.in/dependency/src/lib.rs b/crates/cargo-add/tests/snapshots/add/build_prefer_existing_version.stdout similarity index 100% rename from crates/cargo-add/tests/cmd/add/inline_path.in/dependency/src/lib.rs rename to crates/cargo-add/tests/snapshots/add/build_prefer_existing_version.stdout diff --git a/crates/cargo-add/tests/cmd/add/cargo_config_source_empty.in/.cargo/config b/crates/cargo-add/tests/snapshots/add/cargo_config_source_empty.in/.cargo/config similarity index 100% rename from crates/cargo-add/tests/cmd/add/cargo_config_source_empty.in/.cargo/config rename to crates/cargo-add/tests/snapshots/add/cargo_config_source_empty.in/.cargo/config diff --git a/crates/cargo-add/tests/cmd/add/inline_path_dev.in/primary/Cargo.toml b/crates/cargo-add/tests/snapshots/add/cargo_config_source_empty.in/Cargo.toml similarity index 100% rename from crates/cargo-add/tests/cmd/add/inline_path_dev.in/primary/Cargo.toml rename to crates/cargo-add/tests/snapshots/add/cargo_config_source_empty.in/Cargo.toml diff --git a/crates/cargo-add/tests/cmd/add/inline_path.in/primary/src/lib.rs b/crates/cargo-add/tests/snapshots/add/cargo_config_source_empty.in/src/lib.rs similarity index 100% rename from crates/cargo-add/tests/cmd/add/inline_path.in/primary/src/lib.rs rename to crates/cargo-add/tests/snapshots/add/cargo_config_source_empty.in/src/lib.rs diff --git a/crates/cargo-add/tests/cmd/add/cargo_config_source_empty.out/Cargo.toml b/crates/cargo-add/tests/snapshots/add/cargo_config_source_empty.out/Cargo.toml similarity index 88% rename from crates/cargo-add/tests/cmd/add/cargo_config_source_empty.out/Cargo.toml rename to crates/cargo-add/tests/snapshots/add/cargo_config_source_empty.out/Cargo.toml index 5e2ebf198a..5964c87be7 100644 --- a/crates/cargo-add/tests/cmd/add/cargo_config_source_empty.out/Cargo.toml +++ b/crates/cargo-add/tests/snapshots/add/cargo_config_source_empty.out/Cargo.toml @@ -1,3 +1,5 @@ +[workspace] + [package] name = "cargo-list-test-fixture" version = "0.0.0" diff --git a/crates/cargo-add/tests/snapshots/add/cargo_config_source_empty.stderr b/crates/cargo-add/tests/snapshots/add/cargo_config_source_empty.stderr new file mode 100644 index 0000000000..25b1701bfb --- /dev/null +++ b/crates/cargo-add/tests/snapshots/add/cargo_config_source_empty.stderr @@ -0,0 +1 @@ + Adding my-package v99999.0.0 to dependencies. diff --git a/crates/cargo-add/tests/cmd/add/inline_path_dev.in/dependency/src/lib.rs b/crates/cargo-add/tests/snapshots/add/cargo_config_source_empty.stdout similarity index 100% rename from crates/cargo-add/tests/cmd/add/inline_path_dev.in/dependency/src/lib.rs rename to crates/cargo-add/tests/snapshots/add/cargo_config_source_empty.stdout diff --git a/crates/cargo-add/tests/cmd/add/default_features.in b/crates/cargo-add/tests/snapshots/add/default_features.in similarity index 100% rename from crates/cargo-add/tests/cmd/add/default_features.in rename to crates/cargo-add/tests/snapshots/add/default_features.in diff --git a/crates/cargo-add/tests/cmd/add/default_features.out/Cargo.toml b/crates/cargo-add/tests/snapshots/add/default_features.out/Cargo.toml similarity index 90% rename from crates/cargo-add/tests/cmd/add/default_features.out/Cargo.toml rename to crates/cargo-add/tests/snapshots/add/default_features.out/Cargo.toml index 669085becf..c5e0178928 100644 --- a/crates/cargo-add/tests/cmd/add/default_features.out/Cargo.toml +++ b/crates/cargo-add/tests/snapshots/add/default_features.out/Cargo.toml @@ -1,3 +1,5 @@ +[workspace] + [package] name = "cargo-list-test-fixture" version = "0.0.0" diff --git a/crates/cargo-add/tests/snapshots/add/default_features.stderr b/crates/cargo-add/tests/snapshots/add/default_features.stderr new file mode 100644 index 0000000000..34a94b2539 --- /dev/null +++ b/crates/cargo-add/tests/snapshots/add/default_features.stderr @@ -0,0 +1,3 @@ + Updating '[ROOTURL]/registry' index + Adding my-package1 v99999.0.0 to dependencies. + Adding my-package2 v0.4.1 to dependencies. diff --git a/crates/cargo-add/tests/cmd/add/inline_path_dev.in/primary/src/lib.rs b/crates/cargo-add/tests/snapshots/add/default_features.stdout similarity index 100% rename from crates/cargo-add/tests/cmd/add/inline_path_dev.in/primary/src/lib.rs rename to crates/cargo-add/tests/snapshots/add/default_features.stdout diff --git a/crates/cargo-add/tests/cmd/add/dev.in b/crates/cargo-add/tests/snapshots/add/dev.in similarity index 100% rename from crates/cargo-add/tests/cmd/add/dev.in rename to crates/cargo-add/tests/snapshots/add/dev.in diff --git a/crates/cargo-add/tests/cmd/add/dev.out/Cargo.toml b/crates/cargo-add/tests/snapshots/add/dev.out/Cargo.toml similarity index 91% rename from crates/cargo-add/tests/cmd/add/dev.out/Cargo.toml rename to crates/cargo-add/tests/snapshots/add/dev.out/Cargo.toml index c03035739e..28d9e81ced 100644 --- a/crates/cargo-add/tests/cmd/add/dev.out/Cargo.toml +++ b/crates/cargo-add/tests/snapshots/add/dev.out/Cargo.toml @@ -1,3 +1,5 @@ +[workspace] + [package] name = "cargo-list-test-fixture" version = "0.0.0" diff --git a/crates/cargo-add/tests/snapshots/add/dev.stderr b/crates/cargo-add/tests/snapshots/add/dev.stderr new file mode 100644 index 0000000000..8b1aa52b3b --- /dev/null +++ b/crates/cargo-add/tests/snapshots/add/dev.stderr @@ -0,0 +1,3 @@ + Updating '[ROOTURL]/registry' index + Adding my-dev-package1 v99999.0.0 to dev-dependencies. + Adding my-dev-package2 v99999.0.0 to dev-dependencies. diff --git a/crates/cargo-add/tests/cmd/add/invalid_manifest.in/src/lib.rs b/crates/cargo-add/tests/snapshots/add/dev.stdout similarity index 100% rename from crates/cargo-add/tests/cmd/add/invalid_manifest.in/src/lib.rs rename to crates/cargo-add/tests/snapshots/add/dev.stdout diff --git a/crates/cargo-add/tests/cmd/add/dev_build_conflict.in b/crates/cargo-add/tests/snapshots/add/dev_build_conflict.in similarity index 100% rename from crates/cargo-add/tests/cmd/add/dev_build_conflict.in rename to crates/cargo-add/tests/snapshots/add/dev_build_conflict.in diff --git a/crates/cargo-add/tests/cmd/add/invalid_inline_path.out/Cargo.toml b/crates/cargo-add/tests/snapshots/add/dev_build_conflict.out/Cargo.toml similarity index 82% rename from crates/cargo-add/tests/cmd/add/invalid_inline_path.out/Cargo.toml rename to crates/cargo-add/tests/snapshots/add/dev_build_conflict.out/Cargo.toml index 5e20016d71..3ecdb66816 100644 --- a/crates/cargo-add/tests/cmd/add/invalid_inline_path.out/Cargo.toml +++ b/crates/cargo-add/tests/snapshots/add/dev_build_conflict.out/Cargo.toml @@ -1,3 +1,5 @@ +[workspace] + [package] name = "cargo-list-test-fixture" version = "0.0.0" diff --git a/crates/cargo-add/tests/cmd/add/dev_build_conflict.toml b/crates/cargo-add/tests/snapshots/add/dev_build_conflict.stderr similarity index 57% rename from crates/cargo-add/tests/cmd/add/dev_build_conflict.toml rename to crates/cargo-add/tests/snapshots/add/dev_build_conflict.stderr index 311b56ef6a..3140cfce27 100644 --- a/crates/cargo-add/tests/cmd/add/dev_build_conflict.toml +++ b/crates/cargo-add/tests/snapshots/add/dev_build_conflict.stderr @@ -1,8 +1,3 @@ -bin.name = "cargo-add" -args = ["add", "my-package", "--dev", "--build"] -status.code = 2 -stdout = "" -stderr = """ error: The argument '--dev' cannot be used with '--build' USAGE: @@ -10,8 +5,3 @@ USAGE: cargo add [OPTIONS] [+,...] ... For more information try --help -""" -fs.sandbox = true - -[env.add] -CARGO_IS_TEST="1" diff --git a/crates/cargo-add/tests/cmd/add/list_features_path.in/dependency/src/lib.rs b/crates/cargo-add/tests/snapshots/add/dev_build_conflict.stdout similarity index 100% rename from crates/cargo-add/tests/cmd/add/list_features_path.in/dependency/src/lib.rs rename to crates/cargo-add/tests/snapshots/add/dev_build_conflict.stdout diff --git a/crates/cargo-add/tests/cmd/add/build_prefer_existing_version.in/Cargo.toml b/crates/cargo-add/tests/snapshots/add/dev_prefer_existing_version.in/Cargo.toml similarity index 86% rename from crates/cargo-add/tests/cmd/add/build_prefer_existing_version.in/Cargo.toml rename to crates/cargo-add/tests/snapshots/add/dev_prefer_existing_version.in/Cargo.toml index 51f8875b54..6a6ac823fd 100644 --- a/crates/cargo-add/tests/cmd/add/build_prefer_existing_version.in/Cargo.toml +++ b/crates/cargo-add/tests/snapshots/add/dev_prefer_existing_version.in/Cargo.toml @@ -1,3 +1,6 @@ +[workspace] +exclude = ["dependency"] + [package] name = "cargo-list-test-fixture" version = "0.0.0" diff --git a/crates/cargo-add/tests/cmd/add/dev_prefer_existing_version.in/dependency/Cargo.toml b/crates/cargo-add/tests/snapshots/add/dev_prefer_existing_version.in/dependency/Cargo.toml similarity index 100% rename from crates/cargo-add/tests/cmd/add/dev_prefer_existing_version.in/dependency/Cargo.toml rename to crates/cargo-add/tests/snapshots/add/dev_prefer_existing_version.in/dependency/Cargo.toml diff --git a/crates/cargo-add/tests/cmd/add/list_features_path.in/optional/src/lib.rs b/crates/cargo-add/tests/snapshots/add/dev_prefer_existing_version.in/dependency/src/lib.rs similarity index 100% rename from crates/cargo-add/tests/cmd/add/list_features_path.in/optional/src/lib.rs rename to crates/cargo-add/tests/snapshots/add/dev_prefer_existing_version.in/dependency/src/lib.rs diff --git a/crates/cargo-add/tests/cmd/add/list_features_path.in/primary/src/lib.rs b/crates/cargo-add/tests/snapshots/add/dev_prefer_existing_version.in/src/lib.rs similarity index 100% rename from crates/cargo-add/tests/cmd/add/list_features_path.in/primary/src/lib.rs rename to crates/cargo-add/tests/snapshots/add/dev_prefer_existing_version.in/src/lib.rs diff --git a/crates/cargo-add/tests/cmd/add/dev_prefer_existing_version.out/Cargo.toml b/crates/cargo-add/tests/snapshots/add/dev_prefer_existing_version.out/Cargo.toml similarity index 89% rename from crates/cargo-add/tests/cmd/add/dev_prefer_existing_version.out/Cargo.toml rename to crates/cargo-add/tests/snapshots/add/dev_prefer_existing_version.out/Cargo.toml index 92b2cba018..247f345cf6 100644 --- a/crates/cargo-add/tests/cmd/add/dev_prefer_existing_version.out/Cargo.toml +++ b/crates/cargo-add/tests/snapshots/add/dev_prefer_existing_version.out/Cargo.toml @@ -1,3 +1,6 @@ +[workspace] +exclude = ["dependency"] + [package] name = "cargo-list-test-fixture" version = "0.0.0" diff --git a/crates/cargo-add/tests/cmd/add/dev_prefer_existing_version.out/dependency/Cargo.toml b/crates/cargo-add/tests/snapshots/add/dev_prefer_existing_version.out/dependency/Cargo.toml similarity index 100% rename from crates/cargo-add/tests/cmd/add/dev_prefer_existing_version.out/dependency/Cargo.toml rename to crates/cargo-add/tests/snapshots/add/dev_prefer_existing_version.out/dependency/Cargo.toml diff --git a/crates/cargo-add/tests/snapshots/add/dev_prefer_existing_version.stderr b/crates/cargo-add/tests/snapshots/add/dev_prefer_existing_version.stderr new file mode 100644 index 0000000000..b9cd9cb68c --- /dev/null +++ b/crates/cargo-add/tests/snapshots/add/dev_prefer_existing_version.stderr @@ -0,0 +1,2 @@ + Updating '[ROOTURL]/registry' index + Adding cargo-list-test-fixture-dependency (local) to dev-dependencies. diff --git a/crates/cargo-add/tests/cmd/add/list_features_path_no_default.in/dependency/src/lib.rs b/crates/cargo-add/tests/snapshots/add/dev_prefer_existing_version.stdout similarity index 100% rename from crates/cargo-add/tests/cmd/add/list_features_path_no_default.in/dependency/src/lib.rs rename to crates/cargo-add/tests/snapshots/add/dev_prefer_existing_version.stdout diff --git a/crates/cargo-add/tests/cmd/add/dry_run.in b/crates/cargo-add/tests/snapshots/add/dry_run.in similarity index 100% rename from crates/cargo-add/tests/cmd/add/dry_run.in rename to crates/cargo-add/tests/snapshots/add/dry_run.in diff --git a/crates/cargo-add/tests/cmd/add/invalid_git_no_unstable.out/Cargo.toml b/crates/cargo-add/tests/snapshots/add/dry_run.out/Cargo.toml similarity index 82% rename from crates/cargo-add/tests/cmd/add/invalid_git_no_unstable.out/Cargo.toml rename to crates/cargo-add/tests/snapshots/add/dry_run.out/Cargo.toml index 5e20016d71..3ecdb66816 100644 --- a/crates/cargo-add/tests/cmd/add/invalid_git_no_unstable.out/Cargo.toml +++ b/crates/cargo-add/tests/snapshots/add/dry_run.out/Cargo.toml @@ -1,3 +1,5 @@ +[workspace] + [package] name = "cargo-list-test-fixture" version = "0.0.0" diff --git a/crates/cargo-add/tests/snapshots/add/dry_run.stderr b/crates/cargo-add/tests/snapshots/add/dry_run.stderr new file mode 100644 index 0000000000..f64ce933be --- /dev/null +++ b/crates/cargo-add/tests/snapshots/add/dry_run.stderr @@ -0,0 +1,3 @@ + Updating '[ROOTURL]/registry' index + Adding my-package v99999.0.0 to dependencies. +warning: aborting add due to dry run diff --git a/crates/cargo-add/tests/cmd/add/list_features_path_no_default.in/optional/src/lib.rs b/crates/cargo-add/tests/snapshots/add/dry_run.stdout similarity index 100% rename from crates/cargo-add/tests/cmd/add/list_features_path_no_default.in/optional/src/lib.rs rename to crates/cargo-add/tests/snapshots/add/dry_run.stdout diff --git a/crates/cargo-add/tests/cmd/add/features.in b/crates/cargo-add/tests/snapshots/add/features.in similarity index 100% rename from crates/cargo-add/tests/cmd/add/features.in rename to crates/cargo-add/tests/snapshots/add/features.in diff --git a/crates/cargo-add/tests/cmd/add/features.out/Cargo.toml b/crates/cargo-add/tests/snapshots/add/features.out/Cargo.toml similarity index 91% rename from crates/cargo-add/tests/cmd/add/features.out/Cargo.toml rename to crates/cargo-add/tests/snapshots/add/features.out/Cargo.toml index a866d74a7a..11419b2036 100644 --- a/crates/cargo-add/tests/cmd/add/features.out/Cargo.toml +++ b/crates/cargo-add/tests/snapshots/add/features.out/Cargo.toml @@ -1,3 +1,5 @@ +[workspace] + [package] name = "cargo-list-test-fixture" version = "0.0.0" diff --git a/crates/cargo-add/tests/cmd/add/features_preserve.toml b/crates/cargo-add/tests/snapshots/add/features.stderr similarity index 51% rename from crates/cargo-add/tests/cmd/add/features_preserve.toml rename to crates/cargo-add/tests/snapshots/add/features.stderr index 53b3fa4048..e06e3d673e 100644 --- a/crates/cargo-add/tests/cmd/add/features_preserve.toml +++ b/crates/cargo-add/tests/snapshots/add/features.stderr @@ -1,16 +1,7 @@ -bin.name = "cargo-add" -args = ["add", "your-face"] -status = "success" -stdout = "" -stderr = """ + Updating '[ROOTURL]/registry' index Adding your-face v99999.0.0 to dependencies. Features: + eyes - ears - mouth - nose -""" -fs.sandbox = true - -[env.add] -CARGO_IS_TEST="1" diff --git a/crates/cargo-add/tests/cmd/add/list_features_path_no_default.in/primary/src/lib.rs b/crates/cargo-add/tests/snapshots/add/features.stdout similarity index 100% rename from crates/cargo-add/tests/cmd/add/list_features_path_no_default.in/primary/src/lib.rs rename to crates/cargo-add/tests/snapshots/add/features.stdout diff --git a/crates/cargo-add/tests/cmd/add/features_empty.in b/crates/cargo-add/tests/snapshots/add/features_empty.in similarity index 100% rename from crates/cargo-add/tests/cmd/add/features_empty.in rename to crates/cargo-add/tests/snapshots/add/features_empty.in diff --git a/crates/cargo-add/tests/cmd/add/features_empty.out/Cargo.toml b/crates/cargo-add/tests/snapshots/add/features_empty.out/Cargo.toml similarity index 90% rename from crates/cargo-add/tests/cmd/add/features_empty.out/Cargo.toml rename to crates/cargo-add/tests/snapshots/add/features_empty.out/Cargo.toml index 2ac5cb9ecb..baf204861f 100644 --- a/crates/cargo-add/tests/cmd/add/features_empty.out/Cargo.toml +++ b/crates/cargo-add/tests/snapshots/add/features_empty.out/Cargo.toml @@ -1,3 +1,5 @@ +[workspace] + [package] name = "cargo-list-test-fixture" version = "0.0.0" diff --git a/crates/cargo-add/tests/cmd/add/list_features.toml b/crates/cargo-add/tests/snapshots/add/features_empty.stderr similarity index 51% rename from crates/cargo-add/tests/cmd/add/list_features.toml rename to crates/cargo-add/tests/snapshots/add/features_empty.stderr index 7e401724b0..6d947b800a 100644 --- a/crates/cargo-add/tests/cmd/add/list_features.toml +++ b/crates/cargo-add/tests/snapshots/add/features_empty.stderr @@ -1,16 +1,7 @@ -bin.name = "cargo-add" -args = ["add", "your-face"] -status = "success" -stdout = "" -stderr = """ + Updating '[ROOTURL]/registry' index Adding your-face v99999.0.0 to dependencies. Features: - ears - eyes - mouth - nose -""" -fs.sandbox = true - -[env.add] -CARGO_IS_TEST="1" diff --git a/crates/cargo-add/tests/cmd/add/manifest_path_package.in/dependency/src/lib.rs b/crates/cargo-add/tests/snapshots/add/features_empty.stdout similarity index 100% rename from crates/cargo-add/tests/cmd/add/manifest_path_package.in/dependency/src/lib.rs rename to crates/cargo-add/tests/snapshots/add/features_empty.stdout diff --git a/crates/cargo-add/tests/cmd/add/features_multiple_occurrences.in b/crates/cargo-add/tests/snapshots/add/features_multiple_occurrences.in similarity index 100% rename from crates/cargo-add/tests/cmd/add/features_multiple_occurrences.in rename to crates/cargo-add/tests/snapshots/add/features_multiple_occurrences.in diff --git a/crates/cargo-add/tests/cmd/add/features_multiple_occurrences.out/Cargo.toml b/crates/cargo-add/tests/snapshots/add/features_multiple_occurrences.out/Cargo.toml similarity index 91% rename from crates/cargo-add/tests/cmd/add/features_multiple_occurrences.out/Cargo.toml rename to crates/cargo-add/tests/snapshots/add/features_multiple_occurrences.out/Cargo.toml index 6b9c66ea4a..0060d24bcb 100644 --- a/crates/cargo-add/tests/cmd/add/features_multiple_occurrences.out/Cargo.toml +++ b/crates/cargo-add/tests/snapshots/add/features_multiple_occurrences.out/Cargo.toml @@ -1,3 +1,5 @@ +[workspace] + [package] name = "cargo-list-test-fixture" version = "0.0.0" diff --git a/crates/cargo-add/tests/snapshots/add/features_multiple_occurrences.stderr b/crates/cargo-add/tests/snapshots/add/features_multiple_occurrences.stderr new file mode 100644 index 0000000000..b57e2078df --- /dev/null +++ b/crates/cargo-add/tests/snapshots/add/features_multiple_occurrences.stderr @@ -0,0 +1,7 @@ + Updating '[ROOTURL]/registry' index + Adding your-face v99999.0.0 to dependencies. + Features: + + eyes + + nose + - ears + - mouth diff --git a/crates/cargo-add/tests/cmd/add/manifest_path_package.in/primary/src/lib.rs b/crates/cargo-add/tests/snapshots/add/features_multiple_occurrences.stdout similarity index 100% rename from crates/cargo-add/tests/cmd/add/manifest_path_package.in/primary/src/lib.rs rename to crates/cargo-add/tests/snapshots/add/features_multiple_occurrences.stdout diff --git a/crates/cargo-add/tests/cmd/add/features_preserve.in/Cargo.toml b/crates/cargo-add/tests/snapshots/add/features_preserve.in/Cargo.toml similarity index 91% rename from crates/cargo-add/tests/cmd/add/features_preserve.in/Cargo.toml rename to crates/cargo-add/tests/snapshots/add/features_preserve.in/Cargo.toml index a866d74a7a..11419b2036 100644 --- a/crates/cargo-add/tests/cmd/add/features_preserve.in/Cargo.toml +++ b/crates/cargo-add/tests/snapshots/add/features_preserve.in/Cargo.toml @@ -1,3 +1,5 @@ +[workspace] + [package] name = "cargo-list-test-fixture" version = "0.0.0" diff --git a/crates/cargo-add/tests/cmd/add/overwrite_default_features.in/src/lib.rs b/crates/cargo-add/tests/snapshots/add/features_preserve.in/src/lib.rs similarity index 100% rename from crates/cargo-add/tests/cmd/add/overwrite_default_features.in/src/lib.rs rename to crates/cargo-add/tests/snapshots/add/features_preserve.in/src/lib.rs diff --git a/crates/cargo-add/tests/cmd/add/features_preserve.out/Cargo.toml b/crates/cargo-add/tests/snapshots/add/features_preserve.out/Cargo.toml similarity index 91% rename from crates/cargo-add/tests/cmd/add/features_preserve.out/Cargo.toml rename to crates/cargo-add/tests/snapshots/add/features_preserve.out/Cargo.toml index a866d74a7a..11419b2036 100644 --- a/crates/cargo-add/tests/cmd/add/features_preserve.out/Cargo.toml +++ b/crates/cargo-add/tests/snapshots/add/features_preserve.out/Cargo.toml @@ -1,3 +1,5 @@ +[workspace] + [package] name = "cargo-list-test-fixture" version = "0.0.0" diff --git a/crates/cargo-add/tests/snapshots/add/features_preserve.stderr b/crates/cargo-add/tests/snapshots/add/features_preserve.stderr new file mode 100644 index 0000000000..e06e3d673e --- /dev/null +++ b/crates/cargo-add/tests/snapshots/add/features_preserve.stderr @@ -0,0 +1,7 @@ + Updating '[ROOTURL]/registry' index + Adding your-face v99999.0.0 to dependencies. + Features: + + eyes + - ears + - mouth + - nose diff --git a/crates/cargo-add/tests/cmd/add/overwrite_default_features_with_no_default_features.in/src/lib.rs b/crates/cargo-add/tests/snapshots/add/features_preserve.stdout similarity index 100% rename from crates/cargo-add/tests/cmd/add/overwrite_default_features_with_no_default_features.in/src/lib.rs rename to crates/cargo-add/tests/snapshots/add/features_preserve.stdout diff --git a/crates/cargo-add/tests/cmd/add/features_spaced_values.in b/crates/cargo-add/tests/snapshots/add/features_spaced_values.in similarity index 100% rename from crates/cargo-add/tests/cmd/add/features_spaced_values.in rename to crates/cargo-add/tests/snapshots/add/features_spaced_values.in diff --git a/crates/cargo-add/tests/cmd/add/features_spaced_values.out/Cargo.toml b/crates/cargo-add/tests/snapshots/add/features_spaced_values.out/Cargo.toml similarity index 91% rename from crates/cargo-add/tests/cmd/add/features_spaced_values.out/Cargo.toml rename to crates/cargo-add/tests/snapshots/add/features_spaced_values.out/Cargo.toml index 6b9c66ea4a..0060d24bcb 100644 --- a/crates/cargo-add/tests/cmd/add/features_spaced_values.out/Cargo.toml +++ b/crates/cargo-add/tests/snapshots/add/features_spaced_values.out/Cargo.toml @@ -1,3 +1,5 @@ +[workspace] + [package] name = "cargo-list-test-fixture" version = "0.0.0" diff --git a/crates/cargo-add/tests/snapshots/add/features_spaced_values.stderr b/crates/cargo-add/tests/snapshots/add/features_spaced_values.stderr new file mode 100644 index 0000000000..b57e2078df --- /dev/null +++ b/crates/cargo-add/tests/snapshots/add/features_spaced_values.stderr @@ -0,0 +1,7 @@ + Updating '[ROOTURL]/registry' index + Adding your-face v99999.0.0 to dependencies. + Features: + + eyes + + nose + - ears + - mouth diff --git a/crates/cargo-add/tests/cmd/add/overwrite_features.in/src/lib.rs b/crates/cargo-add/tests/snapshots/add/features_spaced_values.stdout similarity index 100% rename from crates/cargo-add/tests/cmd/add/overwrite_features.in/src/lib.rs rename to crates/cargo-add/tests/snapshots/add/features_spaced_values.stdout diff --git a/crates/cargo-add/tests/cmd/add/features_unknown.in b/crates/cargo-add/tests/snapshots/add/features_unknown.in similarity index 100% rename from crates/cargo-add/tests/cmd/add/features_unknown.in rename to crates/cargo-add/tests/snapshots/add/features_unknown.in diff --git a/crates/cargo-add/tests/cmd/add/features_unknown.out/Cargo.toml b/crates/cargo-add/tests/snapshots/add/features_unknown.out/Cargo.toml similarity index 91% rename from crates/cargo-add/tests/cmd/add/features_unknown.out/Cargo.toml rename to crates/cargo-add/tests/snapshots/add/features_unknown.out/Cargo.toml index a2421d116a..cf421d60c7 100644 --- a/crates/cargo-add/tests/cmd/add/features_unknown.out/Cargo.toml +++ b/crates/cargo-add/tests/snapshots/add/features_unknown.out/Cargo.toml @@ -1,3 +1,5 @@ +[workspace] + [package] name = "cargo-list-test-fixture" version = "0.0.0" diff --git a/crates/cargo-add/tests/snapshots/add/features_unknown.stderr b/crates/cargo-add/tests/snapshots/add/features_unknown.stderr new file mode 100644 index 0000000000..956ee7498d --- /dev/null +++ b/crates/cargo-add/tests/snapshots/add/features_unknown.stderr @@ -0,0 +1,9 @@ + Updating '[ROOTURL]/registry' index +warning: Unrecognized features: ["noze"] + Adding your-face v99999.0.0 to dependencies. + Features: + + noze + - ears + - eyes + - mouth + - nose diff --git a/crates/cargo-add/tests/cmd/add/overwrite_git_with_inline_path.in/dependency/src/lib.rs b/crates/cargo-add/tests/snapshots/add/features_unknown.stdout similarity index 100% rename from crates/cargo-add/tests/cmd/add/overwrite_git_with_inline_path.in/dependency/src/lib.rs rename to crates/cargo-add/tests/snapshots/add/features_unknown.stdout diff --git a/crates/cargo-add/tests/cmd/add/git.in b/crates/cargo-add/tests/snapshots/add/git.in similarity index 100% rename from crates/cargo-add/tests/cmd/add/git.in rename to crates/cargo-add/tests/snapshots/add/git.in diff --git a/crates/cargo-add/tests/cmd/add/git.out/Cargo.toml b/crates/cargo-add/tests/snapshots/add/git.out/Cargo.toml similarity index 91% rename from crates/cargo-add/tests/cmd/add/git.out/Cargo.toml rename to crates/cargo-add/tests/snapshots/add/git.out/Cargo.toml index db25ac21cc..73c30a30a1 100644 --- a/crates/cargo-add/tests/cmd/add/git.out/Cargo.toml +++ b/crates/cargo-add/tests/snapshots/add/git.out/Cargo.toml @@ -1,3 +1,5 @@ +[workspace] + [package] name = "cargo-list-test-fixture" version = "0.0.0" diff --git a/crates/cargo-add/tests/snapshots/add/git.stderr b/crates/cargo-add/tests/snapshots/add/git.stderr new file mode 100644 index 0000000000..5e197df5ca --- /dev/null +++ b/crates/cargo-add/tests/snapshots/add/git.stderr @@ -0,0 +1,2 @@ + Updating '[ROOTURL]/registry' index + Adding git-package (git) to dependencies. diff --git a/crates/cargo-add/tests/cmd/add/overwrite_git_with_inline_path.in/primary/src/lib.rs b/crates/cargo-add/tests/snapshots/add/git.stdout similarity index 100% rename from crates/cargo-add/tests/cmd/add/overwrite_git_with_inline_path.in/primary/src/lib.rs rename to crates/cargo-add/tests/snapshots/add/git.stdout diff --git a/crates/cargo-add/tests/cmd/add/git_branch.in b/crates/cargo-add/tests/snapshots/add/git_branch.in similarity index 100% rename from crates/cargo-add/tests/cmd/add/git_branch.in rename to crates/cargo-add/tests/snapshots/add/git_branch.in diff --git a/crates/cargo-add/tests/cmd/add/git_branch.out/Cargo.toml b/crates/cargo-add/tests/snapshots/add/git_branch.out/Cargo.toml similarity index 92% rename from crates/cargo-add/tests/cmd/add/git_branch.out/Cargo.toml rename to crates/cargo-add/tests/snapshots/add/git_branch.out/Cargo.toml index 5be467eb6b..8c586e3e2e 100644 --- a/crates/cargo-add/tests/cmd/add/git_branch.out/Cargo.toml +++ b/crates/cargo-add/tests/snapshots/add/git_branch.out/Cargo.toml @@ -1,3 +1,5 @@ +[workspace] + [package] name = "cargo-list-test-fixture" version = "0.0.0" diff --git a/crates/cargo-add/tests/snapshots/add/git_branch.stderr b/crates/cargo-add/tests/snapshots/add/git_branch.stderr new file mode 100644 index 0000000000..5e197df5ca --- /dev/null +++ b/crates/cargo-add/tests/snapshots/add/git_branch.stderr @@ -0,0 +1,2 @@ + Updating '[ROOTURL]/registry' index + Adding git-package (git) to dependencies. diff --git a/crates/cargo-add/tests/cmd/add/overwrite_inline_features.in/src/lib.rs b/crates/cargo-add/tests/snapshots/add/git_branch.stdout similarity index 100% rename from crates/cargo-add/tests/cmd/add/overwrite_inline_features.in/src/lib.rs rename to crates/cargo-add/tests/snapshots/add/git_branch.stdout diff --git a/crates/cargo-add/tests/cmd/add/git_conflicts_namever.in b/crates/cargo-add/tests/snapshots/add/git_conflicts_namever.in similarity index 100% rename from crates/cargo-add/tests/cmd/add/git_conflicts_namever.in rename to crates/cargo-add/tests/snapshots/add/git_conflicts_namever.in diff --git a/crates/cargo-add/tests/cmd/add/invalid_git_external.out/Cargo.toml b/crates/cargo-add/tests/snapshots/add/git_conflicts_namever.out/Cargo.toml similarity index 82% rename from crates/cargo-add/tests/cmd/add/invalid_git_external.out/Cargo.toml rename to crates/cargo-add/tests/snapshots/add/git_conflicts_namever.out/Cargo.toml index 5e20016d71..3ecdb66816 100644 --- a/crates/cargo-add/tests/cmd/add/invalid_git_external.out/Cargo.toml +++ b/crates/cargo-add/tests/snapshots/add/git_conflicts_namever.out/Cargo.toml @@ -1,3 +1,5 @@ +[workspace] + [package] name = "cargo-list-test-fixture" version = "0.0.0" diff --git a/crates/cargo-add/tests/snapshots/add/git_conflicts_namever.stderr b/crates/cargo-add/tests/snapshots/add/git_conflicts_namever.stderr new file mode 100644 index 0000000000..2821c4c926 --- /dev/null +++ b/crates/cargo-add/tests/snapshots/add/git_conflicts_namever.stderr @@ -0,0 +1,2 @@ + Updating '[ROOTURL]/registry' index +Error: Cannot specify a git URL (`https://github.com/dcjanus/invalid`) with a version (`0.4.3`). diff --git a/crates/cargo-add/tests/cmd/add/overwrite_name_dev_noop.in/dependency/src/lib.rs b/crates/cargo-add/tests/snapshots/add/git_conflicts_namever.stdout similarity index 100% rename from crates/cargo-add/tests/cmd/add/overwrite_name_dev_noop.in/dependency/src/lib.rs rename to crates/cargo-add/tests/snapshots/add/git_conflicts_namever.stdout diff --git a/crates/cargo-add/tests/cmd/add/git_conflicts_registry.in b/crates/cargo-add/tests/snapshots/add/git_conflicts_registry.in similarity index 100% rename from crates/cargo-add/tests/cmd/add/git_conflicts_registry.in rename to crates/cargo-add/tests/snapshots/add/git_conflicts_registry.in diff --git a/crates/cargo-add/tests/cmd/add/invalid_inline_path_self.out/Cargo.toml b/crates/cargo-add/tests/snapshots/add/git_conflicts_registry.out/Cargo.toml similarity index 82% rename from crates/cargo-add/tests/cmd/add/invalid_inline_path_self.out/Cargo.toml rename to crates/cargo-add/tests/snapshots/add/git_conflicts_registry.out/Cargo.toml index 5e20016d71..3ecdb66816 100644 --- a/crates/cargo-add/tests/cmd/add/invalid_inline_path_self.out/Cargo.toml +++ b/crates/cargo-add/tests/snapshots/add/git_conflicts_registry.out/Cargo.toml @@ -1,3 +1,5 @@ +[workspace] + [package] name = "cargo-list-test-fixture" version = "0.0.0" diff --git a/crates/cargo-add/tests/cmd/add/git_conflicts_registry.toml b/crates/cargo-add/tests/snapshots/add/git_conflicts_registry.stderr similarity index 50% rename from crates/cargo-add/tests/cmd/add/git_conflicts_registry.toml rename to crates/cargo-add/tests/snapshots/add/git_conflicts_registry.stderr index 994eacc341..da4f3a936b 100644 --- a/crates/cargo-add/tests/cmd/add/git_conflicts_registry.toml +++ b/crates/cargo-add/tests/snapshots/add/git_conflicts_registry.stderr @@ -1,8 +1,3 @@ -bin.name = "cargo-add" -args = ["add", "my-package", "--git", "https://github.com/dcjanus/invalid", "--registry", "alternative", "-Zgit"] -status.code = 2 -stdout = "" -stderr = """ error: The argument '--git ' cannot be used with '--registry ' USAGE: @@ -10,8 +5,3 @@ USAGE: cargo add [OPTIONS] [+,...] ... For more information try --help -""" -fs.sandbox = true - -[env.add] -CARGO_IS_TEST="1" diff --git a/crates/cargo-add/tests/cmd/add/overwrite_name_dev_noop.in/src/lib.rs b/crates/cargo-add/tests/snapshots/add/git_conflicts_registry.stdout similarity index 100% rename from crates/cargo-add/tests/cmd/add/overwrite_name_dev_noop.in/src/lib.rs rename to crates/cargo-add/tests/snapshots/add/git_conflicts_registry.stdout diff --git a/crates/cargo-add/tests/cmd/add/git_dev.in b/crates/cargo-add/tests/snapshots/add/git_dev.in similarity index 100% rename from crates/cargo-add/tests/cmd/add/git_dev.in rename to crates/cargo-add/tests/snapshots/add/git_dev.in diff --git a/crates/cargo-add/tests/cmd/add/git_dev.out/Cargo.toml b/crates/cargo-add/tests/snapshots/add/git_dev.out/Cargo.toml similarity index 91% rename from crates/cargo-add/tests/cmd/add/git_dev.out/Cargo.toml rename to crates/cargo-add/tests/snapshots/add/git_dev.out/Cargo.toml index d3b191b7c7..b65abbcf93 100644 --- a/crates/cargo-add/tests/cmd/add/git_dev.out/Cargo.toml +++ b/crates/cargo-add/tests/snapshots/add/git_dev.out/Cargo.toml @@ -1,3 +1,5 @@ +[workspace] + [package] name = "cargo-list-test-fixture" version = "0.0.0" diff --git a/crates/cargo-add/tests/snapshots/add/git_dev.stderr b/crates/cargo-add/tests/snapshots/add/git_dev.stderr new file mode 100644 index 0000000000..81fb1fd21f --- /dev/null +++ b/crates/cargo-add/tests/snapshots/add/git_dev.stderr @@ -0,0 +1,2 @@ + Updating '[ROOTURL]/registry' index + Adding git-package (git) to dev-dependencies. diff --git a/crates/cargo-add/tests/cmd/add/overwrite_name_noop.in/dependency/src/lib.rs b/crates/cargo-add/tests/snapshots/add/git_dev.stdout similarity index 100% rename from crates/cargo-add/tests/cmd/add/overwrite_name_noop.in/dependency/src/lib.rs rename to crates/cargo-add/tests/snapshots/add/git_dev.stdout diff --git a/crates/cargo-add/tests/cmd/add/git_external.in b/crates/cargo-add/tests/snapshots/add/git_external.in similarity index 100% rename from crates/cargo-add/tests/cmd/add/git_external.in rename to crates/cargo-add/tests/snapshots/add/git_external.in diff --git a/crates/cargo-add/tests/cmd/add/git_external.out/Cargo.toml b/crates/cargo-add/tests/snapshots/add/git_external.out/Cargo.toml similarity index 100% rename from crates/cargo-add/tests/cmd/add/git_external.out/Cargo.toml rename to crates/cargo-add/tests/snapshots/add/git_external.out/Cargo.toml diff --git a/crates/cargo-add/tests/cmd/add/git_external.toml b/crates/cargo-add/tests/snapshots/add/git_external.stderr similarity index 69% rename from crates/cargo-add/tests/cmd/add/git_external.toml rename to crates/cargo-add/tests/snapshots/add/git_external.stderr index 6f0b66fb00..7203be4e48 100644 --- a/crates/cargo-add/tests/cmd/add/git_external.toml +++ b/crates/cargo-add/tests/snapshots/add/git_external.stderr @@ -1,8 +1,3 @@ -bin.name = "cargo-add" -args = ["add", "cargo-edit", "--git", "https://github.com/killercup/cargo-edit.git", "--tag", "v0.8.0", "-Zgit"] -status = "success" -stdout = "" -stderr = """ Updating 'https://github.com/rust-lang/crates.io-index' index Adding cargo-edit (git) to dependencies. Features: @@ -18,5 +13,3 @@ stderr = """ + vendored-libgit2 - test-external-apis - vendored-openssl -""" -fs.sandbox = true diff --git a/crates/cargo-add/tests/cmd/add/overwrite_name_noop.in/src/lib.rs b/crates/cargo-add/tests/snapshots/add/git_external.stdout similarity index 100% rename from crates/cargo-add/tests/cmd/add/overwrite_name_noop.in/src/lib.rs rename to crates/cargo-add/tests/snapshots/add/git_external.stdout diff --git a/crates/cargo-add/tests/cmd/add/git_rev.in b/crates/cargo-add/tests/snapshots/add/git_rev.in similarity index 100% rename from crates/cargo-add/tests/cmd/add/git_rev.in rename to crates/cargo-add/tests/snapshots/add/git_rev.in diff --git a/crates/cargo-add/tests/cmd/add/git_rev.out/Cargo.toml b/crates/cargo-add/tests/snapshots/add/git_rev.out/Cargo.toml similarity index 92% rename from crates/cargo-add/tests/cmd/add/git_rev.out/Cargo.toml rename to crates/cargo-add/tests/snapshots/add/git_rev.out/Cargo.toml index 0207a34735..30e7170540 100644 --- a/crates/cargo-add/tests/cmd/add/git_rev.out/Cargo.toml +++ b/crates/cargo-add/tests/snapshots/add/git_rev.out/Cargo.toml @@ -1,3 +1,5 @@ +[workspace] + [package] name = "cargo-list-test-fixture" version = "0.0.0" diff --git a/crates/cargo-add/tests/snapshots/add/git_rev.stderr b/crates/cargo-add/tests/snapshots/add/git_rev.stderr new file mode 100644 index 0000000000..5e197df5ca --- /dev/null +++ b/crates/cargo-add/tests/snapshots/add/git_rev.stderr @@ -0,0 +1,2 @@ + Updating '[ROOTURL]/registry' index + Adding git-package (git) to dependencies. diff --git a/crates/cargo-add/tests/cmd/add/overwrite_no_default_features.in/src/lib.rs b/crates/cargo-add/tests/snapshots/add/git_rev.stdout similarity index 100% rename from crates/cargo-add/tests/cmd/add/overwrite_no_default_features.in/src/lib.rs rename to crates/cargo-add/tests/snapshots/add/git_rev.stdout diff --git a/crates/cargo-add/tests/cmd/add/git_tag.in b/crates/cargo-add/tests/snapshots/add/git_tag.in similarity index 100% rename from crates/cargo-add/tests/cmd/add/git_tag.in rename to crates/cargo-add/tests/snapshots/add/git_tag.in diff --git a/crates/cargo-add/tests/cmd/add/git_tag.out/Cargo.toml b/crates/cargo-add/tests/snapshots/add/git_tag.out/Cargo.toml similarity index 92% rename from crates/cargo-add/tests/cmd/add/git_tag.out/Cargo.toml rename to crates/cargo-add/tests/snapshots/add/git_tag.out/Cargo.toml index ead1c0a9d6..ae8726be5a 100644 --- a/crates/cargo-add/tests/cmd/add/git_tag.out/Cargo.toml +++ b/crates/cargo-add/tests/snapshots/add/git_tag.out/Cargo.toml @@ -1,3 +1,5 @@ +[workspace] + [package] name = "cargo-list-test-fixture" version = "0.0.0" diff --git a/crates/cargo-add/tests/snapshots/add/git_tag.stderr b/crates/cargo-add/tests/snapshots/add/git_tag.stderr new file mode 100644 index 0000000000..5e197df5ca --- /dev/null +++ b/crates/cargo-add/tests/snapshots/add/git_tag.stderr @@ -0,0 +1,2 @@ + Updating '[ROOTURL]/registry' index + Adding git-package (git) to dependencies. diff --git a/crates/cargo-add/tests/cmd/add/overwrite_no_default_features_with_default_features.in/src/lib.rs b/crates/cargo-add/tests/snapshots/add/git_tag.stdout similarity index 100% rename from crates/cargo-add/tests/cmd/add/overwrite_no_default_features_with_default_features.in/src/lib.rs rename to crates/cargo-add/tests/snapshots/add/git_tag.stdout diff --git a/crates/cargo-add/tests/cmd/add/inline_path.in/dependency/Cargo.toml b/crates/cargo-add/tests/snapshots/add/inline_path.in/dependency/Cargo.toml similarity index 100% rename from crates/cargo-add/tests/cmd/add/inline_path.in/dependency/Cargo.toml rename to crates/cargo-add/tests/snapshots/add/inline_path.in/dependency/Cargo.toml diff --git a/crates/cargo-add/tests/cmd/add/overwrite_no_optional.in/src/lib.rs b/crates/cargo-add/tests/snapshots/add/inline_path.in/dependency/src/lib.rs similarity index 100% rename from crates/cargo-add/tests/cmd/add/overwrite_no_optional.in/src/lib.rs rename to crates/cargo-add/tests/snapshots/add/inline_path.in/dependency/src/lib.rs diff --git a/crates/cargo-add/tests/snapshots/add/inline_path.in/primary/Cargo.toml b/crates/cargo-add/tests/snapshots/add/inline_path.in/primary/Cargo.toml new file mode 100644 index 0000000000..3ecdb66816 --- /dev/null +++ b/crates/cargo-add/tests/snapshots/add/inline_path.in/primary/Cargo.toml @@ -0,0 +1,5 @@ +[workspace] + +[package] +name = "cargo-list-test-fixture" +version = "0.0.0" diff --git a/crates/cargo-add/tests/cmd/add/overwrite_no_optional_with_optional.in/src/lib.rs b/crates/cargo-add/tests/snapshots/add/inline_path.in/primary/src/lib.rs similarity index 100% rename from crates/cargo-add/tests/cmd/add/overwrite_no_optional_with_optional.in/src/lib.rs rename to crates/cargo-add/tests/snapshots/add/inline_path.in/primary/src/lib.rs diff --git a/crates/cargo-add/tests/cmd/add/inline_path.out/dependency/Cargo.toml b/crates/cargo-add/tests/snapshots/add/inline_path.out/dependency/Cargo.toml similarity index 100% rename from crates/cargo-add/tests/cmd/add/inline_path.out/dependency/Cargo.toml rename to crates/cargo-add/tests/snapshots/add/inline_path.out/dependency/Cargo.toml diff --git a/crates/cargo-add/tests/cmd/add/inline_path.out/primary/Cargo.toml b/crates/cargo-add/tests/snapshots/add/inline_path.out/primary/Cargo.toml similarity index 100% rename from crates/cargo-add/tests/cmd/add/inline_path.out/primary/Cargo.toml rename to crates/cargo-add/tests/snapshots/add/inline_path.out/primary/Cargo.toml diff --git a/crates/cargo-add/tests/snapshots/add/inline_path.stderr b/crates/cargo-add/tests/snapshots/add/inline_path.stderr new file mode 100644 index 0000000000..0790f5dd1d --- /dev/null +++ b/crates/cargo-add/tests/snapshots/add/inline_path.stderr @@ -0,0 +1,2 @@ + Updating '[ROOTURL]/registry' index + Adding cargo-list-test-fixture-dependency (local) to dependencies. diff --git a/crates/cargo-add/tests/cmd/add/overwrite_optional.in/src/lib.rs b/crates/cargo-add/tests/snapshots/add/inline_path.stdout similarity index 100% rename from crates/cargo-add/tests/cmd/add/overwrite_optional.in/src/lib.rs rename to crates/cargo-add/tests/snapshots/add/inline_path.stdout diff --git a/crates/cargo-add/tests/cmd/add/inline_path_dev.in/dependency/Cargo.toml b/crates/cargo-add/tests/snapshots/add/inline_path_dev.in/dependency/Cargo.toml similarity index 100% rename from crates/cargo-add/tests/cmd/add/inline_path_dev.in/dependency/Cargo.toml rename to crates/cargo-add/tests/snapshots/add/inline_path_dev.in/dependency/Cargo.toml diff --git a/crates/cargo-add/tests/cmd/add/overwrite_optional_with_no_optional.in/src/lib.rs b/crates/cargo-add/tests/snapshots/add/inline_path_dev.in/dependency/src/lib.rs similarity index 100% rename from crates/cargo-add/tests/cmd/add/overwrite_optional_with_no_optional.in/src/lib.rs rename to crates/cargo-add/tests/snapshots/add/inline_path_dev.in/dependency/src/lib.rs diff --git a/crates/cargo-add/tests/snapshots/add/inline_path_dev.in/primary/Cargo.toml b/crates/cargo-add/tests/snapshots/add/inline_path_dev.in/primary/Cargo.toml new file mode 100644 index 0000000000..3ecdb66816 --- /dev/null +++ b/crates/cargo-add/tests/snapshots/add/inline_path_dev.in/primary/Cargo.toml @@ -0,0 +1,5 @@ +[workspace] + +[package] +name = "cargo-list-test-fixture" +version = "0.0.0" diff --git a/crates/cargo-add/tests/cmd/add/overwrite_path_noop.in/dependency/src/lib.rs b/crates/cargo-add/tests/snapshots/add/inline_path_dev.in/primary/src/lib.rs similarity index 100% rename from crates/cargo-add/tests/cmd/add/overwrite_path_noop.in/dependency/src/lib.rs rename to crates/cargo-add/tests/snapshots/add/inline_path_dev.in/primary/src/lib.rs diff --git a/crates/cargo-add/tests/cmd/add/inline_path_dev.out/dependency/Cargo.toml b/crates/cargo-add/tests/snapshots/add/inline_path_dev.out/dependency/Cargo.toml similarity index 100% rename from crates/cargo-add/tests/cmd/add/inline_path_dev.out/dependency/Cargo.toml rename to crates/cargo-add/tests/snapshots/add/inline_path_dev.out/dependency/Cargo.toml diff --git a/crates/cargo-add/tests/cmd/add/inline_path_dev.out/primary/Cargo.toml b/crates/cargo-add/tests/snapshots/add/inline_path_dev.out/primary/Cargo.toml similarity index 100% rename from crates/cargo-add/tests/cmd/add/inline_path_dev.out/primary/Cargo.toml rename to crates/cargo-add/tests/snapshots/add/inline_path_dev.out/primary/Cargo.toml diff --git a/crates/cargo-add/tests/snapshots/add/inline_path_dev.stderr b/crates/cargo-add/tests/snapshots/add/inline_path_dev.stderr new file mode 100644 index 0000000000..b9cd9cb68c --- /dev/null +++ b/crates/cargo-add/tests/snapshots/add/inline_path_dev.stderr @@ -0,0 +1,2 @@ + Updating '[ROOTURL]/registry' index + Adding cargo-list-test-fixture-dependency (local) to dev-dependencies. diff --git a/crates/cargo-add/tests/cmd/add/overwrite_path_noop.in/src/lib.rs b/crates/cargo-add/tests/snapshots/add/inline_path_dev.stdout similarity index 100% rename from crates/cargo-add/tests/cmd/add/overwrite_path_noop.in/src/lib.rs rename to crates/cargo-add/tests/snapshots/add/inline_path_dev.stdout diff --git a/crates/cargo-add/tests/cmd/add/invalid_arg.in b/crates/cargo-add/tests/snapshots/add/invalid_arg.in similarity index 100% rename from crates/cargo-add/tests/cmd/add/invalid_arg.in rename to crates/cargo-add/tests/snapshots/add/invalid_arg.in diff --git a/crates/cargo-add/tests/snapshots/add/invalid_arg.out/Cargo.toml b/crates/cargo-add/tests/snapshots/add/invalid_arg.out/Cargo.toml new file mode 100644 index 0000000000..3ecdb66816 --- /dev/null +++ b/crates/cargo-add/tests/snapshots/add/invalid_arg.out/Cargo.toml @@ -0,0 +1,5 @@ +[workspace] + +[package] +name = "cargo-list-test-fixture" +version = "0.0.0" diff --git a/crates/cargo-add/tests/cmd/add/invalid_arg.toml b/crates/cargo-add/tests/snapshots/add/invalid_arg.stderr similarity index 51% rename from crates/cargo-add/tests/cmd/add/invalid_arg.toml rename to crates/cargo-add/tests/snapshots/add/invalid_arg.stderr index b56fcc8c54..4fcbe4e096 100644 --- a/crates/cargo-add/tests/cmd/add/invalid_arg.toml +++ b/crates/cargo-add/tests/snapshots/add/invalid_arg.stderr @@ -1,19 +1,9 @@ -bin.name = "cargo-add" -args = ["add", "my-package", "--flag"] -status.code = 2 -stdout = "" -stderr = """ error: Found argument '--flag' which wasn't expected, or isn't valid in this context -\tIf you tried to supply `--flag` as a value rather than a flag, use `-- --flag` + If you tried to supply `--flag` as a value rather than a flag, use `-- --flag` USAGE: cargo add [OPTIONS] [@] [+,...] ... cargo add [OPTIONS] [+,...] ... For more information try --help -""" -fs.sandbox = true - -[env.add] -CARGO_IS_TEST="1" diff --git a/crates/cargo-add/tests/cmd/add/overwrite_path_with_version.in/dependency/src/lib.rs b/crates/cargo-add/tests/snapshots/add/invalid_arg.stdout similarity index 100% rename from crates/cargo-add/tests/cmd/add/overwrite_path_with_version.in/dependency/src/lib.rs rename to crates/cargo-add/tests/snapshots/add/invalid_arg.stdout diff --git a/crates/cargo-add/tests/cmd/add/invalid_git_external.in b/crates/cargo-add/tests/snapshots/add/invalid_git_external.in similarity index 100% rename from crates/cargo-add/tests/cmd/add/invalid_git_external.in rename to crates/cargo-add/tests/snapshots/add/invalid_git_external.in diff --git a/crates/cargo-add/tests/cmd/add/add-basic.in/Cargo.toml b/crates/cargo-add/tests/snapshots/add/invalid_git_external.out/Cargo.toml similarity index 100% rename from crates/cargo-add/tests/cmd/add/add-basic.in/Cargo.toml rename to crates/cargo-add/tests/snapshots/add/invalid_git_external.out/Cargo.toml diff --git a/crates/cargo-add/tests/cmd/add/invalid_git_external.toml b/crates/cargo-add/tests/snapshots/add/invalid_git_external.stderr similarity index 59% rename from crates/cargo-add/tests/cmd/add/invalid_git_external.toml rename to crates/cargo-add/tests/snapshots/add/invalid_git_external.stderr index aa280f62f4..d780791a5d 100644 --- a/crates/cargo-add/tests/cmd/add/invalid_git_external.toml +++ b/crates/cargo-add/tests/snapshots/add/invalid_git_external.stderr @@ -1,9 +1,2 @@ -bin.name = "cargo-add" -args = ["add", "fake-git", "--git", "https://github.com/killercup/fake-git-repo.git", "-Zgit"] -status.code = 1 -stdout = "" -stderr = """ Updating 'https://github.com/rust-lang/crates.io-index' index Error: HTTP request `https://raw.githubusercontent.com/killercup/fake-git-repo/master/Cargo.toml` failed: https://raw.githubusercontent.com/killercup/fake-git-repo/master/Cargo.toml: status code 404 -""" -fs.sandbox = true diff --git a/crates/cargo-add/tests/cmd/add/overwrite_path_with_version.in/primary/src/lib.rs b/crates/cargo-add/tests/snapshots/add/invalid_git_external.stdout similarity index 100% rename from crates/cargo-add/tests/cmd/add/overwrite_path_with_version.in/primary/src/lib.rs rename to crates/cargo-add/tests/snapshots/add/invalid_git_external.stdout diff --git a/crates/cargo-add/tests/cmd/add/invalid_git_no_unstable.in b/crates/cargo-add/tests/snapshots/add/invalid_git_no_unstable.in similarity index 100% rename from crates/cargo-add/tests/cmd/add/invalid_git_no_unstable.in rename to crates/cargo-add/tests/snapshots/add/invalid_git_no_unstable.in diff --git a/crates/cargo-add/tests/snapshots/add/invalid_git_no_unstable.out/Cargo.toml b/crates/cargo-add/tests/snapshots/add/invalid_git_no_unstable.out/Cargo.toml new file mode 100644 index 0000000000..3ecdb66816 --- /dev/null +++ b/crates/cargo-add/tests/snapshots/add/invalid_git_no_unstable.out/Cargo.toml @@ -0,0 +1,5 @@ +[workspace] + +[package] +name = "cargo-list-test-fixture" +version = "0.0.0" diff --git a/crates/cargo-add/tests/snapshots/add/invalid_git_no_unstable.stderr b/crates/cargo-add/tests/snapshots/add/invalid_git_no_unstable.stderr new file mode 100644 index 0000000000..75eb567fea --- /dev/null +++ b/crates/cargo-add/tests/snapshots/add/invalid_git_no_unstable.stderr @@ -0,0 +1 @@ +Error: `--git` is unstable and requires `-Z git` diff --git a/crates/cargo-add/tests/cmd/add/overwrite_rename_with_no_rename.in/src/lib.rs b/crates/cargo-add/tests/snapshots/add/invalid_git_no_unstable.stdout similarity index 100% rename from crates/cargo-add/tests/cmd/add/overwrite_rename_with_no_rename.in/src/lib.rs rename to crates/cargo-add/tests/snapshots/add/invalid_git_no_unstable.stdout diff --git a/crates/cargo-add/tests/cmd/add/invalid_inline_path.in b/crates/cargo-add/tests/snapshots/add/invalid_inline_path.in similarity index 100% rename from crates/cargo-add/tests/cmd/add/invalid_inline_path.in rename to crates/cargo-add/tests/snapshots/add/invalid_inline_path.in diff --git a/crates/cargo-add/tests/snapshots/add/invalid_inline_path.out/Cargo.toml b/crates/cargo-add/tests/snapshots/add/invalid_inline_path.out/Cargo.toml new file mode 100644 index 0000000000..3ecdb66816 --- /dev/null +++ b/crates/cargo-add/tests/snapshots/add/invalid_inline_path.out/Cargo.toml @@ -0,0 +1,5 @@ +[workspace] + +[package] +name = "cargo-list-test-fixture" +version = "0.0.0" diff --git a/crates/cargo-add/tests/snapshots/add/invalid_inline_path.stderr b/crates/cargo-add/tests/snapshots/add/invalid_inline_path.stderr new file mode 100644 index 0000000000..7ad3195620 --- /dev/null +++ b/crates/cargo-add/tests/snapshots/add/invalid_inline_path.stderr @@ -0,0 +1,6 @@ + Updating '[ROOTURL]/registry' index +Error: Unable to open local Cargo.toml + +Caused by: + 0: Failed to read manifest contents + 1: [..] diff --git a/crates/cargo-add/tests/cmd/add/overwrite_rename_with_rename.in/src/lib.rs b/crates/cargo-add/tests/snapshots/add/invalid_inline_path.stdout similarity index 100% rename from crates/cargo-add/tests/cmd/add/overwrite_rename_with_rename.in/src/lib.rs rename to crates/cargo-add/tests/snapshots/add/invalid_inline_path.stdout diff --git a/crates/cargo-add/tests/cmd/add/invalid_inline_path_self.in b/crates/cargo-add/tests/snapshots/add/invalid_inline_path_self.in similarity index 100% rename from crates/cargo-add/tests/cmd/add/invalid_inline_path_self.in rename to crates/cargo-add/tests/snapshots/add/invalid_inline_path_self.in diff --git a/crates/cargo-add/tests/snapshots/add/invalid_inline_path_self.out/Cargo.toml b/crates/cargo-add/tests/snapshots/add/invalid_inline_path_self.out/Cargo.toml new file mode 100644 index 0000000000..3ecdb66816 --- /dev/null +++ b/crates/cargo-add/tests/snapshots/add/invalid_inline_path_self.out/Cargo.toml @@ -0,0 +1,5 @@ +[workspace] + +[package] +name = "cargo-list-test-fixture" +version = "0.0.0" diff --git a/crates/cargo-add/tests/snapshots/add/invalid_inline_path_self.stderr b/crates/cargo-add/tests/snapshots/add/invalid_inline_path_self.stderr new file mode 100644 index 0000000000..3f75fe910f --- /dev/null +++ b/crates/cargo-add/tests/snapshots/add/invalid_inline_path_self.stderr @@ -0,0 +1,3 @@ + Updating '[ROOTURL]/registry' index + Adding cargo-list-test-fixture (local) to dependencies. +Error: Cannot add `cargo-list-test-fixture` as a dependency to itself diff --git a/crates/cargo-add/tests/cmd/add/overwrite_rename_with_rename_noop.in/src/lib.rs b/crates/cargo-add/tests/snapshots/add/invalid_inline_path_self.stdout similarity index 100% rename from crates/cargo-add/tests/cmd/add/overwrite_rename_with_rename_noop.in/src/lib.rs rename to crates/cargo-add/tests/snapshots/add/invalid_inline_path_self.stdout diff --git a/crates/cargo-add/tests/cmd/add/invalid_manifest.in/Cargo.toml b/crates/cargo-add/tests/snapshots/add/invalid_manifest.in/Cargo.toml similarity index 89% rename from crates/cargo-add/tests/cmd/add/invalid_manifest.in/Cargo.toml rename to crates/cargo-add/tests/snapshots/add/invalid_manifest.in/Cargo.toml index a3b65b9f32..94ee95994f 100644 --- a/crates/cargo-add/tests/cmd/add/invalid_manifest.in/Cargo.toml +++ b/crates/cargo-add/tests/snapshots/add/invalid_manifest.in/Cargo.toml @@ -1,3 +1,5 @@ +[workspace] + [package] name = "manifest-invalid-test-fixture" version = "0.1.0" diff --git a/crates/cargo-add/tests/cmd/add/overwrite_version_with_git.in/src/lib.rs b/crates/cargo-add/tests/snapshots/add/invalid_manifest.in/src/lib.rs similarity index 100% rename from crates/cargo-add/tests/cmd/add/overwrite_version_with_git.in/src/lib.rs rename to crates/cargo-add/tests/snapshots/add/invalid_manifest.in/src/lib.rs diff --git a/crates/cargo-add/tests/cmd/add/invalid_manifest.out/Cargo.toml b/crates/cargo-add/tests/snapshots/add/invalid_manifest.out/Cargo.toml similarity index 89% rename from crates/cargo-add/tests/cmd/add/invalid_manifest.out/Cargo.toml rename to crates/cargo-add/tests/snapshots/add/invalid_manifest.out/Cargo.toml index a3b65b9f32..94ee95994f 100644 --- a/crates/cargo-add/tests/cmd/add/invalid_manifest.out/Cargo.toml +++ b/crates/cargo-add/tests/snapshots/add/invalid_manifest.out/Cargo.toml @@ -1,3 +1,5 @@ +[workspace] + [package] name = "manifest-invalid-test-fixture" version = "0.1.0" diff --git a/crates/cargo-add/tests/snapshots/add/invalid_manifest.stderr b/crates/cargo-add/tests/snapshots/add/invalid_manifest.stderr new file mode 100644 index 0000000000..5b7ce96d5e --- /dev/null +++ b/crates/cargo-add/tests/snapshots/add/invalid_manifest.stderr @@ -0,0 +1,10 @@ +Error: failed to parse manifest at `[ROOT]/case/Cargo.toml` + +Caused by: + 0: could not parse input as TOML + 1: TOML parse error at line 8, column 7 + | + 8 | key = invalid-value + | ^ + Unexpected `v` + diff --git a/crates/cargo-add/tests/cmd/add/overwrite_version_with_inline_path.in/dependency/src/lib.rs b/crates/cargo-add/tests/snapshots/add/invalid_manifest.stdout similarity index 100% rename from crates/cargo-add/tests/cmd/add/overwrite_version_with_inline_path.in/dependency/src/lib.rs rename to crates/cargo-add/tests/snapshots/add/invalid_manifest.stdout diff --git a/crates/cargo-add/tests/cmd/add/invalid_name_external.in b/crates/cargo-add/tests/snapshots/add/invalid_name_external.in similarity index 100% rename from crates/cargo-add/tests/cmd/add/invalid_name_external.in rename to crates/cargo-add/tests/snapshots/add/invalid_name_external.in diff --git a/crates/cargo-add/tests/snapshots/add/invalid_name_external.out/Cargo.toml b/crates/cargo-add/tests/snapshots/add/invalid_name_external.out/Cargo.toml new file mode 100644 index 0000000000..3ecdb66816 --- /dev/null +++ b/crates/cargo-add/tests/snapshots/add/invalid_name_external.out/Cargo.toml @@ -0,0 +1,5 @@ +[workspace] + +[package] +name = "cargo-list-test-fixture" +version = "0.0.0" diff --git a/crates/cargo-add/tests/snapshots/add/invalid_name_external.stderr b/crates/cargo-add/tests/snapshots/add/invalid_name_external.stderr new file mode 100644 index 0000000000..2c29045948 --- /dev/null +++ b/crates/cargo-add/tests/snapshots/add/invalid_name_external.stderr @@ -0,0 +1,2 @@ + Updating '[ROOTURL]/registry' index +Error: The crate `lets_hope_nobody_ever_publishes_this_crate` could not be found in registry index. diff --git a/crates/cargo-add/tests/cmd/add/overwrite_version_with_inline_path.in/primary/src/lib.rs b/crates/cargo-add/tests/snapshots/add/invalid_name_external.stdout similarity index 100% rename from crates/cargo-add/tests/cmd/add/overwrite_version_with_inline_path.in/primary/src/lib.rs rename to crates/cargo-add/tests/snapshots/add/invalid_name_external.stdout diff --git a/crates/cargo-add/tests/cmd/add/invalid_target_empty.in b/crates/cargo-add/tests/snapshots/add/invalid_target_empty.in similarity index 100% rename from crates/cargo-add/tests/cmd/add/invalid_target_empty.in rename to crates/cargo-add/tests/snapshots/add/invalid_target_empty.in diff --git a/crates/cargo-add/tests/snapshots/add/invalid_target_empty.out/Cargo.toml b/crates/cargo-add/tests/snapshots/add/invalid_target_empty.out/Cargo.toml new file mode 100644 index 0000000000..3ecdb66816 --- /dev/null +++ b/crates/cargo-add/tests/snapshots/add/invalid_target_empty.out/Cargo.toml @@ -0,0 +1,5 @@ +[workspace] + +[package] +name = "cargo-list-test-fixture" +version = "0.0.0" diff --git a/crates/cargo-add/tests/cmd/add/invalid_target_empty.toml b/crates/cargo-add/tests/snapshots/add/invalid_target_empty.stderr similarity index 59% rename from crates/cargo-add/tests/cmd/add/invalid_target_empty.toml rename to crates/cargo-add/tests/snapshots/add/invalid_target_empty.stderr index e2ca2dedf9..6d0f18f6a5 100644 --- a/crates/cargo-add/tests/cmd/add/invalid_target_empty.toml +++ b/crates/cargo-add/tests/snapshots/add/invalid_target_empty.stderr @@ -1,8 +1,3 @@ -bin.name = "cargo-add" -args = ["add", "my-package", "--target", ""] -status.code = 2 -stdout = "" -stderr = """ error: The argument '--target ' requires a value but none was supplied USAGE: @@ -10,8 +5,3 @@ USAGE: cargo add [OPTIONS] [+,...] ... For more information try --help -""" -fs.sandbox = true - -[env.add] -CARGO_IS_TEST="1" diff --git a/crates/cargo-add/tests/cmd/add/overwrite_with_rename.in/src/lib.rs b/crates/cargo-add/tests/snapshots/add/invalid_target_empty.stdout similarity index 100% rename from crates/cargo-add/tests/cmd/add/overwrite_with_rename.in/src/lib.rs rename to crates/cargo-add/tests/snapshots/add/invalid_target_empty.stdout diff --git a/crates/cargo-add/tests/cmd/add/invalid_vers.in b/crates/cargo-add/tests/snapshots/add/invalid_vers.in similarity index 100% rename from crates/cargo-add/tests/cmd/add/invalid_vers.in rename to crates/cargo-add/tests/snapshots/add/invalid_vers.in diff --git a/crates/cargo-add/tests/snapshots/add/invalid_vers.out/Cargo.toml b/crates/cargo-add/tests/snapshots/add/invalid_vers.out/Cargo.toml new file mode 100644 index 0000000000..3ecdb66816 --- /dev/null +++ b/crates/cargo-add/tests/snapshots/add/invalid_vers.out/Cargo.toml @@ -0,0 +1,5 @@ +[workspace] + +[package] +name = "cargo-list-test-fixture" +version = "0.0.0" diff --git a/crates/cargo-add/tests/snapshots/add/invalid_vers.stderr b/crates/cargo-add/tests/snapshots/add/invalid_vers.stderr new file mode 100644 index 0000000000..f1ff182148 --- /dev/null +++ b/crates/cargo-add/tests/snapshots/add/invalid_vers.stderr @@ -0,0 +1,5 @@ + Updating '[ROOTURL]/registry' index +Error: Invalid version requirement `invalid version string` + +Caused by: + unexpected character 'i' while parsing major version number diff --git a/crates/cargo-add/tests/cmd/add/preserve_sorted.in/src/lib.rs b/crates/cargo-add/tests/snapshots/add/invalid_vers.stdout similarity index 100% rename from crates/cargo-add/tests/cmd/add/preserve_sorted.in/src/lib.rs rename to crates/cargo-add/tests/snapshots/add/invalid_vers.stdout diff --git a/crates/cargo-add/tests/cmd/add/list_features.in b/crates/cargo-add/tests/snapshots/add/list_features.in similarity index 100% rename from crates/cargo-add/tests/cmd/add/list_features.in rename to crates/cargo-add/tests/snapshots/add/list_features.in diff --git a/crates/cargo-add/tests/cmd/add/list_features.out/Cargo.toml b/crates/cargo-add/tests/snapshots/add/list_features.out/Cargo.toml similarity index 88% rename from crates/cargo-add/tests/cmd/add/list_features.out/Cargo.toml rename to crates/cargo-add/tests/snapshots/add/list_features.out/Cargo.toml index 7cd740b9f0..79d735a12d 100644 --- a/crates/cargo-add/tests/cmd/add/list_features.out/Cargo.toml +++ b/crates/cargo-add/tests/snapshots/add/list_features.out/Cargo.toml @@ -1,3 +1,5 @@ +[workspace] + [package] name = "cargo-list-test-fixture" version = "0.0.0" diff --git a/crates/cargo-add/tests/snapshots/add/list_features.stderr b/crates/cargo-add/tests/snapshots/add/list_features.stderr new file mode 100644 index 0000000000..6d947b800a --- /dev/null +++ b/crates/cargo-add/tests/snapshots/add/list_features.stderr @@ -0,0 +1,7 @@ + Updating '[ROOTURL]/registry' index + Adding your-face v99999.0.0 to dependencies. + Features: + - ears + - eyes + - mouth + - nose diff --git a/crates/cargo-add/tests/cmd/add/preserve_unsorted.in/src/lib.rs b/crates/cargo-add/tests/snapshots/add/list_features.stdout similarity index 100% rename from crates/cargo-add/tests/cmd/add/preserve_unsorted.in/src/lib.rs rename to crates/cargo-add/tests/snapshots/add/list_features.stdout diff --git a/crates/cargo-add/tests/cmd/add/list_features_path.in/Cargo.toml b/crates/cargo-add/tests/snapshots/add/list_features_path.in/Cargo.toml similarity index 100% rename from crates/cargo-add/tests/cmd/add/list_features_path.in/Cargo.toml rename to crates/cargo-add/tests/snapshots/add/list_features_path.in/Cargo.toml diff --git a/crates/cargo-add/tests/cmd/add/list_features_path.in/dependency/Cargo.toml b/crates/cargo-add/tests/snapshots/add/list_features_path.in/dependency/Cargo.toml similarity index 100% rename from crates/cargo-add/tests/cmd/add/list_features_path.in/dependency/Cargo.toml rename to crates/cargo-add/tests/snapshots/add/list_features_path.in/dependency/Cargo.toml diff --git a/crates/cargo-add/tests/cmd/add/registry.in/src/lib.rs b/crates/cargo-add/tests/snapshots/add/list_features_path.in/dependency/src/lib.rs similarity index 100% rename from crates/cargo-add/tests/cmd/add/registry.in/src/lib.rs rename to crates/cargo-add/tests/snapshots/add/list_features_path.in/dependency/src/lib.rs diff --git a/crates/cargo-add/tests/cmd/add/list_features_path.in/optional/Cargo.toml b/crates/cargo-add/tests/snapshots/add/list_features_path.in/optional/Cargo.toml similarity index 100% rename from crates/cargo-add/tests/cmd/add/list_features_path.in/optional/Cargo.toml rename to crates/cargo-add/tests/snapshots/add/list_features_path.in/optional/Cargo.toml diff --git a/crates/cargo-add/tests/cmd/add/workspace_inline_path.in/dependency/src/lib.rs b/crates/cargo-add/tests/snapshots/add/list_features_path.in/optional/src/lib.rs similarity index 100% rename from crates/cargo-add/tests/cmd/add/workspace_inline_path.in/dependency/src/lib.rs rename to crates/cargo-add/tests/snapshots/add/list_features_path.in/optional/src/lib.rs diff --git a/crates/cargo-add/tests/cmd/add/cargo_config_source_empty.in/Cargo.toml b/crates/cargo-add/tests/snapshots/add/list_features_path.in/primary/Cargo.toml similarity index 100% rename from crates/cargo-add/tests/cmd/add/cargo_config_source_empty.in/Cargo.toml rename to crates/cargo-add/tests/snapshots/add/list_features_path.in/primary/Cargo.toml diff --git a/crates/cargo-add/tests/cmd/add/workspace_inline_path.in/primary/src/lib.rs b/crates/cargo-add/tests/snapshots/add/list_features_path.in/primary/src/lib.rs similarity index 100% rename from crates/cargo-add/tests/cmd/add/workspace_inline_path.in/primary/src/lib.rs rename to crates/cargo-add/tests/snapshots/add/list_features_path.in/primary/src/lib.rs diff --git a/crates/cargo-add/tests/cmd/add/list_features_path.out/Cargo.toml b/crates/cargo-add/tests/snapshots/add/list_features_path.out/Cargo.toml similarity index 100% rename from crates/cargo-add/tests/cmd/add/list_features_path.out/Cargo.toml rename to crates/cargo-add/tests/snapshots/add/list_features_path.out/Cargo.toml diff --git a/crates/cargo-add/tests/cmd/add/list_features_path.out/dependency/Cargo.toml b/crates/cargo-add/tests/snapshots/add/list_features_path.out/dependency/Cargo.toml similarity index 100% rename from crates/cargo-add/tests/cmd/add/list_features_path.out/dependency/Cargo.toml rename to crates/cargo-add/tests/snapshots/add/list_features_path.out/dependency/Cargo.toml diff --git a/crates/cargo-add/tests/cmd/add/list_features_path.out/primary/Cargo.toml b/crates/cargo-add/tests/snapshots/add/list_features_path.out/primary/Cargo.toml similarity index 100% rename from crates/cargo-add/tests/cmd/add/list_features_path.out/primary/Cargo.toml rename to crates/cargo-add/tests/snapshots/add/list_features_path.out/primary/Cargo.toml diff --git a/crates/cargo-add/tests/cmd/add/list_features_path.toml b/crates/cargo-add/tests/snapshots/add/list_features_path.stderr similarity index 51% rename from crates/cargo-add/tests/cmd/add/list_features_path.toml rename to crates/cargo-add/tests/snapshots/add/list_features_path.stderr index 10a6154c28..fc34b1d224 100644 --- a/crates/cargo-add/tests/cmd/add/list_features_path.toml +++ b/crates/cargo-add/tests/snapshots/add/list_features_path.stderr @@ -1,8 +1,4 @@ -bin.name = "cargo-add" -args = ["add", "cargo-list-test-fixture-dependency", "../dependency"] -status = "success" -stdout = "" -stderr = """ + Updating '[ROOTURL]/registry' index Adding cargo-list-test-fixture-dependency v99999.0.0 to dependencies. Adding your-face (local) to dependencies. Features: @@ -10,9 +6,3 @@ stderr = """ + nose - eyes - optional-dependency -""" -fs.sandbox = true -fs.cwd = "list_features_path.in/primary" - -[env.add] -CARGO_IS_TEST="1" diff --git a/crates/cargo-add/tests/cmd/add/workspace_inline_path_dev.in/dependency/src/lib.rs b/crates/cargo-add/tests/snapshots/add/list_features_path.stdout similarity index 100% rename from crates/cargo-add/tests/cmd/add/workspace_inline_path_dev.in/dependency/src/lib.rs rename to crates/cargo-add/tests/snapshots/add/list_features_path.stdout diff --git a/crates/cargo-add/tests/cmd/add/list_features_path_no_default.in/Cargo.toml b/crates/cargo-add/tests/snapshots/add/list_features_path_no_default.in/Cargo.toml similarity index 100% rename from crates/cargo-add/tests/cmd/add/list_features_path_no_default.in/Cargo.toml rename to crates/cargo-add/tests/snapshots/add/list_features_path_no_default.in/Cargo.toml diff --git a/crates/cargo-add/tests/cmd/add/list_features_path_no_default.in/dependency/Cargo.toml b/crates/cargo-add/tests/snapshots/add/list_features_path_no_default.in/dependency/Cargo.toml similarity index 100% rename from crates/cargo-add/tests/cmd/add/list_features_path_no_default.in/dependency/Cargo.toml rename to crates/cargo-add/tests/snapshots/add/list_features_path_no_default.in/dependency/Cargo.toml diff --git a/crates/cargo-add/tests/cmd/add/workspace_inline_path_dev.in/primary/src/lib.rs b/crates/cargo-add/tests/snapshots/add/list_features_path_no_default.in/dependency/src/lib.rs similarity index 100% rename from crates/cargo-add/tests/cmd/add/workspace_inline_path_dev.in/primary/src/lib.rs rename to crates/cargo-add/tests/snapshots/add/list_features_path_no_default.in/dependency/src/lib.rs diff --git a/crates/cargo-add/tests/cmd/add/list_features_path_no_default.in/optional/Cargo.toml b/crates/cargo-add/tests/snapshots/add/list_features_path_no_default.in/optional/Cargo.toml similarity index 100% rename from crates/cargo-add/tests/cmd/add/list_features_path_no_default.in/optional/Cargo.toml rename to crates/cargo-add/tests/snapshots/add/list_features_path_no_default.in/optional/Cargo.toml diff --git a/crates/cargo-add/tests/cmd/add/workspace_name.in/dependency/src/lib.rs b/crates/cargo-add/tests/snapshots/add/list_features_path_no_default.in/optional/src/lib.rs similarity index 100% rename from crates/cargo-add/tests/cmd/add/workspace_name.in/dependency/src/lib.rs rename to crates/cargo-add/tests/snapshots/add/list_features_path_no_default.in/optional/src/lib.rs diff --git a/crates/cargo-add/tests/cmd/add/dev_build_conflict.out/Cargo.toml b/crates/cargo-add/tests/snapshots/add/list_features_path_no_default.in/primary/Cargo.toml similarity index 100% rename from crates/cargo-add/tests/cmd/add/dev_build_conflict.out/Cargo.toml rename to crates/cargo-add/tests/snapshots/add/list_features_path_no_default.in/primary/Cargo.toml diff --git a/crates/cargo-add/tests/cmd/add/workspace_name.in/primary/src/lib.rs b/crates/cargo-add/tests/snapshots/add/list_features_path_no_default.in/primary/src/lib.rs similarity index 100% rename from crates/cargo-add/tests/cmd/add/workspace_name.in/primary/src/lib.rs rename to crates/cargo-add/tests/snapshots/add/list_features_path_no_default.in/primary/src/lib.rs diff --git a/crates/cargo-add/tests/cmd/add/list_features_path_no_default.out/Cargo.toml b/crates/cargo-add/tests/snapshots/add/list_features_path_no_default.out/Cargo.toml similarity index 100% rename from crates/cargo-add/tests/cmd/add/list_features_path_no_default.out/Cargo.toml rename to crates/cargo-add/tests/snapshots/add/list_features_path_no_default.out/Cargo.toml diff --git a/crates/cargo-add/tests/cmd/add/list_features_path_no_default.out/dependency/Cargo.toml b/crates/cargo-add/tests/snapshots/add/list_features_path_no_default.out/dependency/Cargo.toml similarity index 100% rename from crates/cargo-add/tests/cmd/add/list_features_path_no_default.out/dependency/Cargo.toml rename to crates/cargo-add/tests/snapshots/add/list_features_path_no_default.out/dependency/Cargo.toml diff --git a/crates/cargo-add/tests/cmd/add/list_features_path_no_default.out/primary/Cargo.toml b/crates/cargo-add/tests/snapshots/add/list_features_path_no_default.out/primary/Cargo.toml similarity index 100% rename from crates/cargo-add/tests/cmd/add/list_features_path_no_default.out/primary/Cargo.toml rename to crates/cargo-add/tests/snapshots/add/list_features_path_no_default.out/primary/Cargo.toml diff --git a/crates/cargo-add/tests/snapshots/add/list_features_path_no_default.stderr b/crates/cargo-add/tests/snapshots/add/list_features_path_no_default.stderr new file mode 100644 index 0000000000..523868c8f8 --- /dev/null +++ b/crates/cargo-add/tests/snapshots/add/list_features_path_no_default.stderr @@ -0,0 +1,8 @@ + Updating '[ROOTURL]/registry' index + Adding cargo-list-test-fixture-dependency v99999.0.0 to dependencies. + Adding your-face (local) to dependencies. + Features: + - eyes + - mouth + - nose + - optional-dependency diff --git a/crates/cargo-add/tests/snapshots/add/list_features_path_no_default.stdout b/crates/cargo-add/tests/snapshots/add/list_features_path_no_default.stdout new file mode 100644 index 0000000000..e69de29bb2 diff --git a/crates/cargo-add/tests/cmd/add/manifest_path_package.in/Cargo.toml b/crates/cargo-add/tests/snapshots/add/manifest_path_package.in/Cargo.toml similarity index 100% rename from crates/cargo-add/tests/cmd/add/manifest_path_package.in/Cargo.toml rename to crates/cargo-add/tests/snapshots/add/manifest_path_package.in/Cargo.toml diff --git a/crates/cargo-add/tests/cmd/add/manifest_path_package.in/dependency/Cargo.toml b/crates/cargo-add/tests/snapshots/add/manifest_path_package.in/dependency/Cargo.toml similarity index 100% rename from crates/cargo-add/tests/cmd/add/manifest_path_package.in/dependency/Cargo.toml rename to crates/cargo-add/tests/snapshots/add/manifest_path_package.in/dependency/Cargo.toml diff --git a/crates/cargo-add/tests/snapshots/add/manifest_path_package.in/dependency/src/lib.rs b/crates/cargo-add/tests/snapshots/add/manifest_path_package.in/dependency/src/lib.rs new file mode 100644 index 0000000000..e69de29bb2 diff --git a/crates/cargo-add/tests/cmd/add/dry_run.out/Cargo.toml b/crates/cargo-add/tests/snapshots/add/manifest_path_package.in/primary/Cargo.toml similarity index 100% rename from crates/cargo-add/tests/cmd/add/dry_run.out/Cargo.toml rename to crates/cargo-add/tests/snapshots/add/manifest_path_package.in/primary/Cargo.toml diff --git a/crates/cargo-add/tests/snapshots/add/manifest_path_package.in/primary/src/lib.rs b/crates/cargo-add/tests/snapshots/add/manifest_path_package.in/primary/src/lib.rs new file mode 100644 index 0000000000..e69de29bb2 diff --git a/crates/cargo-add/tests/cmd/add/manifest_path_package.out/Cargo.toml b/crates/cargo-add/tests/snapshots/add/manifest_path_package.out/Cargo.toml similarity index 100% rename from crates/cargo-add/tests/cmd/add/manifest_path_package.out/Cargo.toml rename to crates/cargo-add/tests/snapshots/add/manifest_path_package.out/Cargo.toml diff --git a/crates/cargo-add/tests/cmd/add/manifest_path_package.out/dependency/Cargo.toml b/crates/cargo-add/tests/snapshots/add/manifest_path_package.out/dependency/Cargo.toml similarity index 100% rename from crates/cargo-add/tests/cmd/add/manifest_path_package.out/dependency/Cargo.toml rename to crates/cargo-add/tests/snapshots/add/manifest_path_package.out/dependency/Cargo.toml diff --git a/crates/cargo-add/tests/cmd/add/manifest_path_package.out/primary/Cargo.toml b/crates/cargo-add/tests/snapshots/add/manifest_path_package.out/primary/Cargo.toml similarity index 100% rename from crates/cargo-add/tests/cmd/add/manifest_path_package.out/primary/Cargo.toml rename to crates/cargo-add/tests/snapshots/add/manifest_path_package.out/primary/Cargo.toml diff --git a/crates/cargo-add/tests/snapshots/add/manifest_path_package.stderr b/crates/cargo-add/tests/snapshots/add/manifest_path_package.stderr new file mode 100644 index 0000000000..0790f5dd1d --- /dev/null +++ b/crates/cargo-add/tests/snapshots/add/manifest_path_package.stderr @@ -0,0 +1,2 @@ + Updating '[ROOTURL]/registry' index + Adding cargo-list-test-fixture-dependency (local) to dependencies. diff --git a/crates/cargo-add/tests/snapshots/add/manifest_path_package.stdout b/crates/cargo-add/tests/snapshots/add/manifest_path_package.stdout new file mode 100644 index 0000000000..e69de29bb2 diff --git a/crates/cargo-add/tests/cmd/add/multiple_conflicts_with_features.in b/crates/cargo-add/tests/snapshots/add/multiple_conflicts_with_features.in similarity index 100% rename from crates/cargo-add/tests/cmd/add/multiple_conflicts_with_features.in rename to crates/cargo-add/tests/snapshots/add/multiple_conflicts_with_features.in diff --git a/crates/cargo-add/tests/snapshots/add/multiple_conflicts_with_features.out/Cargo.toml b/crates/cargo-add/tests/snapshots/add/multiple_conflicts_with_features.out/Cargo.toml new file mode 100644 index 0000000000..3ecdb66816 --- /dev/null +++ b/crates/cargo-add/tests/snapshots/add/multiple_conflicts_with_features.out/Cargo.toml @@ -0,0 +1,5 @@ +[workspace] + +[package] +name = "cargo-list-test-fixture" +version = "0.0.0" diff --git a/crates/cargo-add/tests/snapshots/add/multiple_conflicts_with_features.stderr b/crates/cargo-add/tests/snapshots/add/multiple_conflicts_with_features.stderr new file mode 100644 index 0000000000..17188a4a2b --- /dev/null +++ b/crates/cargo-add/tests/snapshots/add/multiple_conflicts_with_features.stderr @@ -0,0 +1 @@ +Error: Cannot specify multiple crates with features diff --git a/crates/cargo-add/tests/snapshots/add/multiple_conflicts_with_features.stdout b/crates/cargo-add/tests/snapshots/add/multiple_conflicts_with_features.stdout new file mode 100644 index 0000000000..e69de29bb2 diff --git a/crates/cargo-add/tests/cmd/add/multiple_conflicts_with_git.in b/crates/cargo-add/tests/snapshots/add/multiple_conflicts_with_git.in similarity index 100% rename from crates/cargo-add/tests/cmd/add/multiple_conflicts_with_git.in rename to crates/cargo-add/tests/snapshots/add/multiple_conflicts_with_git.in diff --git a/crates/cargo-add/tests/snapshots/add/multiple_conflicts_with_git.out/Cargo.toml b/crates/cargo-add/tests/snapshots/add/multiple_conflicts_with_git.out/Cargo.toml new file mode 100644 index 0000000000..3ecdb66816 --- /dev/null +++ b/crates/cargo-add/tests/snapshots/add/multiple_conflicts_with_git.out/Cargo.toml @@ -0,0 +1,5 @@ +[workspace] + +[package] +name = "cargo-list-test-fixture" +version = "0.0.0" diff --git a/crates/cargo-add/tests/snapshots/add/multiple_conflicts_with_git.stderr b/crates/cargo-add/tests/snapshots/add/multiple_conflicts_with_git.stderr new file mode 100644 index 0000000000..e067bcafa8 --- /dev/null +++ b/crates/cargo-add/tests/snapshots/add/multiple_conflicts_with_git.stderr @@ -0,0 +1 @@ +Error: Cannot specify multiple crates with path or git or vers diff --git a/crates/cargo-add/tests/snapshots/add/multiple_conflicts_with_git.stdout b/crates/cargo-add/tests/snapshots/add/multiple_conflicts_with_git.stdout new file mode 100644 index 0000000000..e69de29bb2 diff --git a/crates/cargo-add/tests/cmd/add/multiple_conflicts_with_rename.in b/crates/cargo-add/tests/snapshots/add/multiple_conflicts_with_rename.in similarity index 100% rename from crates/cargo-add/tests/cmd/add/multiple_conflicts_with_rename.in rename to crates/cargo-add/tests/snapshots/add/multiple_conflicts_with_rename.in diff --git a/crates/cargo-add/tests/snapshots/add/multiple_conflicts_with_rename.out/Cargo.toml b/crates/cargo-add/tests/snapshots/add/multiple_conflicts_with_rename.out/Cargo.toml new file mode 100644 index 0000000000..3ecdb66816 --- /dev/null +++ b/crates/cargo-add/tests/snapshots/add/multiple_conflicts_with_rename.out/Cargo.toml @@ -0,0 +1,5 @@ +[workspace] + +[package] +name = "cargo-list-test-fixture" +version = "0.0.0" diff --git a/crates/cargo-add/tests/snapshots/add/multiple_conflicts_with_rename.stderr b/crates/cargo-add/tests/snapshots/add/multiple_conflicts_with_rename.stderr new file mode 100644 index 0000000000..5586b236d6 --- /dev/null +++ b/crates/cargo-add/tests/snapshots/add/multiple_conflicts_with_rename.stderr @@ -0,0 +1 @@ +Error: Cannot specify multiple crates with rename diff --git a/crates/cargo-add/tests/snapshots/add/multiple_conflicts_with_rename.stdout b/crates/cargo-add/tests/snapshots/add/multiple_conflicts_with_rename.stdout new file mode 100644 index 0000000000..e69de29bb2 diff --git a/crates/cargo-add/tests/cmd/add/namever.in b/crates/cargo-add/tests/snapshots/add/namever.in similarity index 100% rename from crates/cargo-add/tests/cmd/add/namever.in rename to crates/cargo-add/tests/snapshots/add/namever.in diff --git a/crates/cargo-add/tests/cmd/add/namever.out/Cargo.toml b/crates/cargo-add/tests/snapshots/add/namever.out/Cargo.toml similarity index 91% rename from crates/cargo-add/tests/cmd/add/namever.out/Cargo.toml rename to crates/cargo-add/tests/snapshots/add/namever.out/Cargo.toml index 82087761c9..1704d3435d 100644 --- a/crates/cargo-add/tests/cmd/add/namever.out/Cargo.toml +++ b/crates/cargo-add/tests/snapshots/add/namever.out/Cargo.toml @@ -1,3 +1,5 @@ +[workspace] + [package] name = "cargo-list-test-fixture" version = "0.0.0" diff --git a/crates/cargo-add/tests/snapshots/add/namever.stderr b/crates/cargo-add/tests/snapshots/add/namever.stderr new file mode 100644 index 0000000000..8b334b330b --- /dev/null +++ b/crates/cargo-add/tests/snapshots/add/namever.stderr @@ -0,0 +1,4 @@ + Updating '[ROOTURL]/registry' index + Adding my-package1 >=0.1.1 to dependencies. + Adding my-package2 v0.2.3 to dependencies. + Adding my-package v99999.0.0 to dependencies. diff --git a/crates/cargo-add/tests/snapshots/add/namever.stdout b/crates/cargo-add/tests/snapshots/add/namever.stdout new file mode 100644 index 0000000000..e69de29bb2 diff --git a/crates/cargo-add/tests/cmd/add/no_args.in b/crates/cargo-add/tests/snapshots/add/no_args.in similarity index 100% rename from crates/cargo-add/tests/cmd/add/no_args.in rename to crates/cargo-add/tests/snapshots/add/no_args.in diff --git a/crates/cargo-add/tests/snapshots/add/no_args.out/Cargo.toml b/crates/cargo-add/tests/snapshots/add/no_args.out/Cargo.toml new file mode 100644 index 0000000000..3ecdb66816 --- /dev/null +++ b/crates/cargo-add/tests/snapshots/add/no_args.out/Cargo.toml @@ -0,0 +1,5 @@ +[workspace] + +[package] +name = "cargo-list-test-fixture" +version = "0.0.0" diff --git a/crates/cargo-add/tests/cmd/add/no_args.toml b/crates/cargo-add/tests/snapshots/add/no_args.stderr similarity index 64% rename from crates/cargo-add/tests/cmd/add/no_args.toml rename to crates/cargo-add/tests/snapshots/add/no_args.stderr index 1bf2f68aaf..cce4ecf781 100644 --- a/crates/cargo-add/tests/cmd/add/no_args.toml +++ b/crates/cargo-add/tests/snapshots/add/no_args.stderr @@ -1,8 +1,3 @@ -bin.name = "cargo-add" -args = ["add"] -status.code = 2 -stdout = "" -stderr = """ error: The following required arguments were not provided: ... @@ -11,8 +6,3 @@ USAGE: cargo add [OPTIONS] [+,...] ... For more information try --help -""" -fs.sandbox = true - -[env.add] -CARGO_IS_TEST="1" diff --git a/crates/cargo-add/tests/snapshots/add/no_args.stdout b/crates/cargo-add/tests/snapshots/add/no_args.stdout new file mode 100644 index 0000000000..e69de29bb2 diff --git a/crates/cargo-add/tests/cmd/add/no_default_features.in b/crates/cargo-add/tests/snapshots/add/no_default_features.in similarity index 100% rename from crates/cargo-add/tests/cmd/add/no_default_features.in rename to crates/cargo-add/tests/snapshots/add/no_default_features.in diff --git a/crates/cargo-add/tests/cmd/add/no_default_features.out/Cargo.toml b/crates/cargo-add/tests/snapshots/add/no_default_features.out/Cargo.toml similarity index 94% rename from crates/cargo-add/tests/cmd/add/no_default_features.out/Cargo.toml rename to crates/cargo-add/tests/snapshots/add/no_default_features.out/Cargo.toml index 1b18e65275..ddd02b1f05 100644 --- a/crates/cargo-add/tests/cmd/add/no_default_features.out/Cargo.toml +++ b/crates/cargo-add/tests/snapshots/add/no_default_features.out/Cargo.toml @@ -1,3 +1,5 @@ +[workspace] + [package] name = "cargo-list-test-fixture" version = "0.0.0" diff --git a/crates/cargo-add/tests/snapshots/add/no_default_features.stderr b/crates/cargo-add/tests/snapshots/add/no_default_features.stderr new file mode 100644 index 0000000000..34a94b2539 --- /dev/null +++ b/crates/cargo-add/tests/snapshots/add/no_default_features.stderr @@ -0,0 +1,3 @@ + Updating '[ROOTURL]/registry' index + Adding my-package1 v99999.0.0 to dependencies. + Adding my-package2 v0.4.1 to dependencies. diff --git a/crates/cargo-add/tests/snapshots/add/no_default_features.stdout b/crates/cargo-add/tests/snapshots/add/no_default_features.stdout new file mode 100644 index 0000000000..e69de29bb2 diff --git a/crates/cargo-add/tests/cmd/add/no_optional.in b/crates/cargo-add/tests/snapshots/add/no_optional.in similarity index 100% rename from crates/cargo-add/tests/cmd/add/no_optional.in rename to crates/cargo-add/tests/snapshots/add/no_optional.in diff --git a/crates/cargo-add/tests/cmd/add/no_optional.out/Cargo.toml b/crates/cargo-add/tests/snapshots/add/no_optional.out/Cargo.toml similarity index 90% rename from crates/cargo-add/tests/cmd/add/no_optional.out/Cargo.toml rename to crates/cargo-add/tests/snapshots/add/no_optional.out/Cargo.toml index 669085becf..c5e0178928 100644 --- a/crates/cargo-add/tests/cmd/add/no_optional.out/Cargo.toml +++ b/crates/cargo-add/tests/snapshots/add/no_optional.out/Cargo.toml @@ -1,3 +1,5 @@ +[workspace] + [package] name = "cargo-list-test-fixture" version = "0.0.0" diff --git a/crates/cargo-add/tests/snapshots/add/no_optional.stderr b/crates/cargo-add/tests/snapshots/add/no_optional.stderr new file mode 100644 index 0000000000..34a94b2539 --- /dev/null +++ b/crates/cargo-add/tests/snapshots/add/no_optional.stderr @@ -0,0 +1,3 @@ + Updating '[ROOTURL]/registry' index + Adding my-package1 v99999.0.0 to dependencies. + Adding my-package2 v0.4.1 to dependencies. diff --git a/crates/cargo-add/tests/snapshots/add/no_optional.stdout b/crates/cargo-add/tests/snapshots/add/no_optional.stdout new file mode 100644 index 0000000000..e69de29bb2 diff --git a/crates/cargo-add/tests/cmd/add/optional.in b/crates/cargo-add/tests/snapshots/add/optional.in similarity index 100% rename from crates/cargo-add/tests/cmd/add/optional.in rename to crates/cargo-add/tests/snapshots/add/optional.in diff --git a/crates/cargo-add/tests/cmd/add/optional.out/Cargo.toml b/crates/cargo-add/tests/snapshots/add/optional.out/Cargo.toml similarity index 93% rename from crates/cargo-add/tests/cmd/add/optional.out/Cargo.toml rename to crates/cargo-add/tests/snapshots/add/optional.out/Cargo.toml index 9276b728fe..eda5445c50 100644 --- a/crates/cargo-add/tests/cmd/add/optional.out/Cargo.toml +++ b/crates/cargo-add/tests/snapshots/add/optional.out/Cargo.toml @@ -1,3 +1,5 @@ +[workspace] + [package] name = "cargo-list-test-fixture" version = "0.0.0" diff --git a/crates/cargo-add/tests/snapshots/add/optional.stderr b/crates/cargo-add/tests/snapshots/add/optional.stderr new file mode 100644 index 0000000000..ce269cf2bd --- /dev/null +++ b/crates/cargo-add/tests/snapshots/add/optional.stderr @@ -0,0 +1,3 @@ + Updating '[ROOTURL]/registry' index + Adding my-package1 v99999.0.0 to optional dependencies. + Adding my-package2 v0.4.1 to optional dependencies. diff --git a/crates/cargo-add/tests/snapshots/add/optional.stdout b/crates/cargo-add/tests/snapshots/add/optional.stdout new file mode 100644 index 0000000000..e69de29bb2 diff --git a/crates/cargo-add/tests/cmd/add/overwrite_default_features.out/Cargo.toml b/crates/cargo-add/tests/snapshots/add/overwrite_default_features.in/Cargo.toml similarity index 90% rename from crates/cargo-add/tests/cmd/add/overwrite_default_features.out/Cargo.toml rename to crates/cargo-add/tests/snapshots/add/overwrite_default_features.in/Cargo.toml index 669085becf..c5e0178928 100644 --- a/crates/cargo-add/tests/cmd/add/overwrite_default_features.out/Cargo.toml +++ b/crates/cargo-add/tests/snapshots/add/overwrite_default_features.in/Cargo.toml @@ -1,3 +1,5 @@ +[workspace] + [package] name = "cargo-list-test-fixture" version = "0.0.0" diff --git a/crates/cargo-add/tests/snapshots/add/overwrite_default_features.in/src/lib.rs b/crates/cargo-add/tests/snapshots/add/overwrite_default_features.in/src/lib.rs new file mode 100644 index 0000000000..e69de29bb2 diff --git a/crates/cargo-add/tests/cmd/add/overwrite_default_features.in/Cargo.toml b/crates/cargo-add/tests/snapshots/add/overwrite_default_features.out/Cargo.toml similarity index 90% rename from crates/cargo-add/tests/cmd/add/overwrite_default_features.in/Cargo.toml rename to crates/cargo-add/tests/snapshots/add/overwrite_default_features.out/Cargo.toml index 669085becf..c5e0178928 100644 --- a/crates/cargo-add/tests/cmd/add/overwrite_default_features.in/Cargo.toml +++ b/crates/cargo-add/tests/snapshots/add/overwrite_default_features.out/Cargo.toml @@ -1,3 +1,5 @@ +[workspace] + [package] name = "cargo-list-test-fixture" version = "0.0.0" diff --git a/crates/cargo-add/tests/snapshots/add/overwrite_default_features.stderr b/crates/cargo-add/tests/snapshots/add/overwrite_default_features.stderr new file mode 100644 index 0000000000..34a94b2539 --- /dev/null +++ b/crates/cargo-add/tests/snapshots/add/overwrite_default_features.stderr @@ -0,0 +1,3 @@ + Updating '[ROOTURL]/registry' index + Adding my-package1 v99999.0.0 to dependencies. + Adding my-package2 v0.4.1 to dependencies. diff --git a/crates/cargo-add/tests/snapshots/add/overwrite_default_features.stdout b/crates/cargo-add/tests/snapshots/add/overwrite_default_features.stdout new file mode 100644 index 0000000000..e69de29bb2 diff --git a/crates/cargo-add/tests/cmd/add/overwrite_default_features_with_no_default_features.in/Cargo.toml b/crates/cargo-add/tests/snapshots/add/overwrite_default_features_with_no_default_features.in/Cargo.toml similarity index 93% rename from crates/cargo-add/tests/cmd/add/overwrite_default_features_with_no_default_features.in/Cargo.toml rename to crates/cargo-add/tests/snapshots/add/overwrite_default_features_with_no_default_features.in/Cargo.toml index a63d53ccf5..73f56a7a32 100644 --- a/crates/cargo-add/tests/cmd/add/overwrite_default_features_with_no_default_features.in/Cargo.toml +++ b/crates/cargo-add/tests/snapshots/add/overwrite_default_features_with_no_default_features.in/Cargo.toml @@ -1,3 +1,5 @@ +[workspace] + [package] name = "cargo-list-test-fixture" version = "0.0.0" diff --git a/crates/cargo-add/tests/snapshots/add/overwrite_default_features_with_no_default_features.in/src/lib.rs b/crates/cargo-add/tests/snapshots/add/overwrite_default_features_with_no_default_features.in/src/lib.rs new file mode 100644 index 0000000000..e69de29bb2 diff --git a/crates/cargo-add/tests/cmd/add/overwrite_no_default_features_with_default_features.in/Cargo.toml b/crates/cargo-add/tests/snapshots/add/overwrite_default_features_with_no_default_features.out/Cargo.toml similarity index 94% rename from crates/cargo-add/tests/cmd/add/overwrite_no_default_features_with_default_features.in/Cargo.toml rename to crates/cargo-add/tests/snapshots/add/overwrite_default_features_with_no_default_features.out/Cargo.toml index 1b18e65275..ddd02b1f05 100644 --- a/crates/cargo-add/tests/cmd/add/overwrite_no_default_features_with_default_features.in/Cargo.toml +++ b/crates/cargo-add/tests/snapshots/add/overwrite_default_features_with_no_default_features.out/Cargo.toml @@ -1,3 +1,5 @@ +[workspace] + [package] name = "cargo-list-test-fixture" version = "0.0.0" diff --git a/crates/cargo-add/tests/snapshots/add/overwrite_default_features_with_no_default_features.stderr b/crates/cargo-add/tests/snapshots/add/overwrite_default_features_with_no_default_features.stderr new file mode 100644 index 0000000000..34a94b2539 --- /dev/null +++ b/crates/cargo-add/tests/snapshots/add/overwrite_default_features_with_no_default_features.stderr @@ -0,0 +1,3 @@ + Updating '[ROOTURL]/registry' index + Adding my-package1 v99999.0.0 to dependencies. + Adding my-package2 v0.4.1 to dependencies. diff --git a/crates/cargo-add/tests/snapshots/add/overwrite_default_features_with_no_default_features.stdout b/crates/cargo-add/tests/snapshots/add/overwrite_default_features_with_no_default_features.stdout new file mode 100644 index 0000000000..e69de29bb2 diff --git a/crates/cargo-add/tests/cmd/add/overwrite_features.in/Cargo.toml b/crates/cargo-add/tests/snapshots/add/overwrite_features.in/Cargo.toml similarity index 91% rename from crates/cargo-add/tests/cmd/add/overwrite_features.in/Cargo.toml rename to crates/cargo-add/tests/snapshots/add/overwrite_features.in/Cargo.toml index a866d74a7a..11419b2036 100644 --- a/crates/cargo-add/tests/cmd/add/overwrite_features.in/Cargo.toml +++ b/crates/cargo-add/tests/snapshots/add/overwrite_features.in/Cargo.toml @@ -1,3 +1,5 @@ +[workspace] + [package] name = "cargo-list-test-fixture" version = "0.0.0" diff --git a/crates/cargo-add/tests/snapshots/add/overwrite_features.in/src/lib.rs b/crates/cargo-add/tests/snapshots/add/overwrite_features.in/src/lib.rs new file mode 100644 index 0000000000..e69de29bb2 diff --git a/crates/cargo-add/tests/cmd/add/overwrite_features.out/Cargo.toml b/crates/cargo-add/tests/snapshots/add/overwrite_features.out/Cargo.toml similarity index 91% rename from crates/cargo-add/tests/cmd/add/overwrite_features.out/Cargo.toml rename to crates/cargo-add/tests/snapshots/add/overwrite_features.out/Cargo.toml index 6b9c66ea4a..0060d24bcb 100644 --- a/crates/cargo-add/tests/cmd/add/overwrite_features.out/Cargo.toml +++ b/crates/cargo-add/tests/snapshots/add/overwrite_features.out/Cargo.toml @@ -1,3 +1,5 @@ +[workspace] + [package] name = "cargo-list-test-fixture" version = "0.0.0" diff --git a/crates/cargo-add/tests/snapshots/add/overwrite_features.stderr b/crates/cargo-add/tests/snapshots/add/overwrite_features.stderr new file mode 100644 index 0000000000..b57e2078df --- /dev/null +++ b/crates/cargo-add/tests/snapshots/add/overwrite_features.stderr @@ -0,0 +1,7 @@ + Updating '[ROOTURL]/registry' index + Adding your-face v99999.0.0 to dependencies. + Features: + + eyes + + nose + - ears + - mouth diff --git a/crates/cargo-add/tests/snapshots/add/overwrite_features.stdout b/crates/cargo-add/tests/snapshots/add/overwrite_features.stdout new file mode 100644 index 0000000000..e69de29bb2 diff --git a/crates/cargo-add/tests/cmd/add/overwrite_git_with_inline_path.in/dependency/Cargo.toml b/crates/cargo-add/tests/snapshots/add/overwrite_git_with_inline_path.in/dependency/Cargo.toml similarity index 100% rename from crates/cargo-add/tests/cmd/add/overwrite_git_with_inline_path.in/dependency/Cargo.toml rename to crates/cargo-add/tests/snapshots/add/overwrite_git_with_inline_path.in/dependency/Cargo.toml diff --git a/crates/cargo-add/tests/snapshots/add/overwrite_git_with_inline_path.in/dependency/src/lib.rs b/crates/cargo-add/tests/snapshots/add/overwrite_git_with_inline_path.in/dependency/src/lib.rs new file mode 100644 index 0000000000..e69de29bb2 diff --git a/crates/cargo-add/tests/cmd/add/overwrite_git_with_inline_path.in/primary/Cargo.toml b/crates/cargo-add/tests/snapshots/add/overwrite_git_with_inline_path.in/primary/Cargo.toml similarity index 100% rename from crates/cargo-add/tests/cmd/add/overwrite_git_with_inline_path.in/primary/Cargo.toml rename to crates/cargo-add/tests/snapshots/add/overwrite_git_with_inline_path.in/primary/Cargo.toml diff --git a/crates/cargo-add/tests/snapshots/add/overwrite_git_with_inline_path.in/primary/src/lib.rs b/crates/cargo-add/tests/snapshots/add/overwrite_git_with_inline_path.in/primary/src/lib.rs new file mode 100644 index 0000000000..e69de29bb2 diff --git a/crates/cargo-add/tests/cmd/add/overwrite_git_with_inline_path.out/dependency/Cargo.toml b/crates/cargo-add/tests/snapshots/add/overwrite_git_with_inline_path.out/dependency/Cargo.toml similarity index 100% rename from crates/cargo-add/tests/cmd/add/overwrite_git_with_inline_path.out/dependency/Cargo.toml rename to crates/cargo-add/tests/snapshots/add/overwrite_git_with_inline_path.out/dependency/Cargo.toml diff --git a/crates/cargo-add/tests/cmd/add/overwrite_git_with_inline_path.out/primary/Cargo.toml b/crates/cargo-add/tests/snapshots/add/overwrite_git_with_inline_path.out/primary/Cargo.toml similarity index 100% rename from crates/cargo-add/tests/cmd/add/overwrite_git_with_inline_path.out/primary/Cargo.toml rename to crates/cargo-add/tests/snapshots/add/overwrite_git_with_inline_path.out/primary/Cargo.toml diff --git a/crates/cargo-add/tests/snapshots/add/overwrite_git_with_inline_path.stderr b/crates/cargo-add/tests/snapshots/add/overwrite_git_with_inline_path.stderr new file mode 100644 index 0000000000..c1d8ae6584 --- /dev/null +++ b/crates/cargo-add/tests/snapshots/add/overwrite_git_with_inline_path.stderr @@ -0,0 +1,2 @@ + Updating '[ROOTURL]/registry' index + Adding cargo-list-test-fixture-dependency (local) to optional dependencies. diff --git a/crates/cargo-add/tests/snapshots/add/overwrite_git_with_inline_path.stdout b/crates/cargo-add/tests/snapshots/add/overwrite_git_with_inline_path.stdout new file mode 100644 index 0000000000..e69de29bb2 diff --git a/crates/cargo-add/tests/snapshots/add/overwrite_inline_features.in/Cargo.toml b/crates/cargo-add/tests/snapshots/add/overwrite_inline_features.in/Cargo.toml new file mode 100644 index 0000000000..11419b2036 --- /dev/null +++ b/crates/cargo-add/tests/snapshots/add/overwrite_inline_features.in/Cargo.toml @@ -0,0 +1,8 @@ +[workspace] + +[package] +name = "cargo-list-test-fixture" +version = "0.0.0" + +[dependencies] +your-face = { version = "99999.0.0", features = ["eyes"] } diff --git a/crates/cargo-add/tests/snapshots/add/overwrite_inline_features.in/src/lib.rs b/crates/cargo-add/tests/snapshots/add/overwrite_inline_features.in/src/lib.rs new file mode 100644 index 0000000000..e69de29bb2 diff --git a/crates/cargo-add/tests/cmd/add/overwrite_inline_features.out/Cargo.toml b/crates/cargo-add/tests/snapshots/add/overwrite_inline_features.out/Cargo.toml similarity index 93% rename from crates/cargo-add/tests/cmd/add/overwrite_inline_features.out/Cargo.toml rename to crates/cargo-add/tests/snapshots/add/overwrite_inline_features.out/Cargo.toml index 71d2c3cbe1..8e9579dc65 100644 --- a/crates/cargo-add/tests/cmd/add/overwrite_inline_features.out/Cargo.toml +++ b/crates/cargo-add/tests/snapshots/add/overwrite_inline_features.out/Cargo.toml @@ -1,3 +1,5 @@ +[workspace] + [package] name = "cargo-list-test-fixture" version = "0.0.0" diff --git a/crates/cargo-add/tests/cmd/add/overwrite_inline_features.toml b/crates/cargo-add/tests/snapshots/add/overwrite_inline_features.stderr similarity index 50% rename from crates/cargo-add/tests/cmd/add/overwrite_inline_features.toml rename to crates/cargo-add/tests/snapshots/add/overwrite_inline_features.stderr index b88ad5777a..e3cdac0690 100644 --- a/crates/cargo-add/tests/cmd/add/overwrite_inline_features.toml +++ b/crates/cargo-add/tests/snapshots/add/overwrite_inline_features.stderr @@ -1,8 +1,4 @@ -bin.name = "cargo-add" -args = ["add", "unrelateed-crate", "your-face", "+nose,mouth", "+ears", "-Zinline-add"] -status = "success" -stdout = "" -stderr = """ + Updating '[ROOTURL]/registry' index Adding unrelateed-crate v99999.0.0 to dependencies. Adding your-face v99999.0.0 to dependencies. Features: @@ -10,8 +6,3 @@ stderr = """ + eyes + mouth + nose -""" -fs.sandbox = true - -[env.add] -CARGO_IS_TEST="1" diff --git a/crates/cargo-add/tests/snapshots/add/overwrite_inline_features.stdout b/crates/cargo-add/tests/snapshots/add/overwrite_inline_features.stdout new file mode 100644 index 0000000000..e69de29bb2 diff --git a/crates/cargo-add/tests/cmd/add/overwrite_name_dev_noop.out/Cargo.toml b/crates/cargo-add/tests/snapshots/add/overwrite_name_dev_noop.in/Cargo.toml similarity index 86% rename from crates/cargo-add/tests/cmd/add/overwrite_name_dev_noop.out/Cargo.toml rename to crates/cargo-add/tests/snapshots/add/overwrite_name_dev_noop.in/Cargo.toml index 4580f0ec21..76a581fef5 100644 --- a/crates/cargo-add/tests/cmd/add/overwrite_name_dev_noop.out/Cargo.toml +++ b/crates/cargo-add/tests/snapshots/add/overwrite_name_dev_noop.in/Cargo.toml @@ -1,3 +1,6 @@ +[workspace] +exclude = ["dependency"] + [package] name = "cargo-list-test-fixture" version = "0.0.0" diff --git a/crates/cargo-add/tests/cmd/add/overwrite_name_dev_noop.in/dependency/Cargo.toml b/crates/cargo-add/tests/snapshots/add/overwrite_name_dev_noop.in/dependency/Cargo.toml similarity index 100% rename from crates/cargo-add/tests/cmd/add/overwrite_name_dev_noop.in/dependency/Cargo.toml rename to crates/cargo-add/tests/snapshots/add/overwrite_name_dev_noop.in/dependency/Cargo.toml diff --git a/crates/cargo-add/tests/snapshots/add/overwrite_name_dev_noop.in/dependency/src/lib.rs b/crates/cargo-add/tests/snapshots/add/overwrite_name_dev_noop.in/dependency/src/lib.rs new file mode 100644 index 0000000000..e69de29bb2 diff --git a/crates/cargo-add/tests/snapshots/add/overwrite_name_dev_noop.in/src/lib.rs b/crates/cargo-add/tests/snapshots/add/overwrite_name_dev_noop.in/src/lib.rs new file mode 100644 index 0000000000..e69de29bb2 diff --git a/crates/cargo-add/tests/cmd/add/overwrite_name_dev_noop.in/Cargo.toml b/crates/cargo-add/tests/snapshots/add/overwrite_name_dev_noop.out/Cargo.toml similarity index 86% rename from crates/cargo-add/tests/cmd/add/overwrite_name_dev_noop.in/Cargo.toml rename to crates/cargo-add/tests/snapshots/add/overwrite_name_dev_noop.out/Cargo.toml index 4580f0ec21..76a581fef5 100644 --- a/crates/cargo-add/tests/cmd/add/overwrite_name_dev_noop.in/Cargo.toml +++ b/crates/cargo-add/tests/snapshots/add/overwrite_name_dev_noop.out/Cargo.toml @@ -1,3 +1,6 @@ +[workspace] +exclude = ["dependency"] + [package] name = "cargo-list-test-fixture" version = "0.0.0" diff --git a/crates/cargo-add/tests/cmd/add/overwrite_name_dev_noop.out/dependency/Cargo.toml b/crates/cargo-add/tests/snapshots/add/overwrite_name_dev_noop.out/dependency/Cargo.toml similarity index 100% rename from crates/cargo-add/tests/cmd/add/overwrite_name_dev_noop.out/dependency/Cargo.toml rename to crates/cargo-add/tests/snapshots/add/overwrite_name_dev_noop.out/dependency/Cargo.toml diff --git a/crates/cargo-add/tests/snapshots/add/overwrite_name_dev_noop.stderr b/crates/cargo-add/tests/snapshots/add/overwrite_name_dev_noop.stderr new file mode 100644 index 0000000000..8e3be1d6f4 --- /dev/null +++ b/crates/cargo-add/tests/snapshots/add/overwrite_name_dev_noop.stderr @@ -0,0 +1,6 @@ + Updating '[ROOTURL]/registry' index +warning: Unrecognized features: ["one", "two"] + Adding cargo-list-test-fixture-dependency (local) to dev-dependencies. + Features: + + one + + two diff --git a/crates/cargo-add/tests/snapshots/add/overwrite_name_dev_noop.stdout b/crates/cargo-add/tests/snapshots/add/overwrite_name_dev_noop.stdout new file mode 100644 index 0000000000..e69de29bb2 diff --git a/crates/cargo-add/tests/cmd/add/dev_prefer_existing_version.in/Cargo.toml b/crates/cargo-add/tests/snapshots/add/overwrite_name_noop.in/Cargo.toml similarity index 86% rename from crates/cargo-add/tests/cmd/add/dev_prefer_existing_version.in/Cargo.toml rename to crates/cargo-add/tests/snapshots/add/overwrite_name_noop.in/Cargo.toml index 51f8875b54..6a6ac823fd 100644 --- a/crates/cargo-add/tests/cmd/add/dev_prefer_existing_version.in/Cargo.toml +++ b/crates/cargo-add/tests/snapshots/add/overwrite_name_noop.in/Cargo.toml @@ -1,3 +1,6 @@ +[workspace] +exclude = ["dependency"] + [package] name = "cargo-list-test-fixture" version = "0.0.0" diff --git a/crates/cargo-add/tests/cmd/add/overwrite_name_noop.in/dependency/Cargo.toml b/crates/cargo-add/tests/snapshots/add/overwrite_name_noop.in/dependency/Cargo.toml similarity index 100% rename from crates/cargo-add/tests/cmd/add/overwrite_name_noop.in/dependency/Cargo.toml rename to crates/cargo-add/tests/snapshots/add/overwrite_name_noop.in/dependency/Cargo.toml diff --git a/crates/cargo-add/tests/snapshots/add/overwrite_name_noop.in/dependency/src/lib.rs b/crates/cargo-add/tests/snapshots/add/overwrite_name_noop.in/dependency/src/lib.rs new file mode 100644 index 0000000000..e69de29bb2 diff --git a/crates/cargo-add/tests/snapshots/add/overwrite_name_noop.in/src/lib.rs b/crates/cargo-add/tests/snapshots/add/overwrite_name_noop.in/src/lib.rs new file mode 100644 index 0000000000..e69de29bb2 diff --git a/crates/cargo-add/tests/cmd/add/overwrite_name_noop.in/Cargo.toml b/crates/cargo-add/tests/snapshots/add/overwrite_name_noop.out/Cargo.toml similarity index 86% rename from crates/cargo-add/tests/cmd/add/overwrite_name_noop.in/Cargo.toml rename to crates/cargo-add/tests/snapshots/add/overwrite_name_noop.out/Cargo.toml index 51f8875b54..6a6ac823fd 100644 --- a/crates/cargo-add/tests/cmd/add/overwrite_name_noop.in/Cargo.toml +++ b/crates/cargo-add/tests/snapshots/add/overwrite_name_noop.out/Cargo.toml @@ -1,3 +1,6 @@ +[workspace] +exclude = ["dependency"] + [package] name = "cargo-list-test-fixture" version = "0.0.0" diff --git a/crates/cargo-add/tests/cmd/add/overwrite_name_noop.out/dependency/Cargo.toml b/crates/cargo-add/tests/snapshots/add/overwrite_name_noop.out/dependency/Cargo.toml similarity index 100% rename from crates/cargo-add/tests/cmd/add/overwrite_name_noop.out/dependency/Cargo.toml rename to crates/cargo-add/tests/snapshots/add/overwrite_name_noop.out/dependency/Cargo.toml diff --git a/crates/cargo-add/tests/snapshots/add/overwrite_name_noop.stderr b/crates/cargo-add/tests/snapshots/add/overwrite_name_noop.stderr new file mode 100644 index 0000000000..8db5f6898c --- /dev/null +++ b/crates/cargo-add/tests/snapshots/add/overwrite_name_noop.stderr @@ -0,0 +1,6 @@ + Updating '[ROOTURL]/registry' index +warning: Unrecognized features: ["one", "two"] + Adding cargo-list-test-fixture-dependency (local) to optional dependencies. + Features: + + one + + two diff --git a/crates/cargo-add/tests/snapshots/add/overwrite_name_noop.stdout b/crates/cargo-add/tests/snapshots/add/overwrite_name_noop.stdout new file mode 100644 index 0000000000..e69de29bb2 diff --git a/crates/cargo-add/tests/snapshots/add/overwrite_no_default_features.in/Cargo.toml b/crates/cargo-add/tests/snapshots/add/overwrite_no_default_features.in/Cargo.toml new file mode 100644 index 0000000000..c5e0178928 --- /dev/null +++ b/crates/cargo-add/tests/snapshots/add/overwrite_no_default_features.in/Cargo.toml @@ -0,0 +1,9 @@ +[workspace] + +[package] +name = "cargo-list-test-fixture" +version = "0.0.0" + +[dependencies] +my-package1 = "99999.0.0" +my-package2 = "0.4.1" diff --git a/crates/cargo-add/tests/snapshots/add/overwrite_no_default_features.in/src/lib.rs b/crates/cargo-add/tests/snapshots/add/overwrite_no_default_features.in/src/lib.rs new file mode 100644 index 0000000000..e69de29bb2 diff --git a/crates/cargo-add/tests/cmd/add/overwrite_default_features_with_no_default_features.out/Cargo.toml b/crates/cargo-add/tests/snapshots/add/overwrite_no_default_features.out/Cargo.toml similarity index 94% rename from crates/cargo-add/tests/cmd/add/overwrite_default_features_with_no_default_features.out/Cargo.toml rename to crates/cargo-add/tests/snapshots/add/overwrite_no_default_features.out/Cargo.toml index 1b18e65275..ddd02b1f05 100644 --- a/crates/cargo-add/tests/cmd/add/overwrite_default_features_with_no_default_features.out/Cargo.toml +++ b/crates/cargo-add/tests/snapshots/add/overwrite_no_default_features.out/Cargo.toml @@ -1,3 +1,5 @@ +[workspace] + [package] name = "cargo-list-test-fixture" version = "0.0.0" diff --git a/crates/cargo-add/tests/snapshots/add/overwrite_no_default_features.stderr b/crates/cargo-add/tests/snapshots/add/overwrite_no_default_features.stderr new file mode 100644 index 0000000000..34a94b2539 --- /dev/null +++ b/crates/cargo-add/tests/snapshots/add/overwrite_no_default_features.stderr @@ -0,0 +1,3 @@ + Updating '[ROOTURL]/registry' index + Adding my-package1 v99999.0.0 to dependencies. + Adding my-package2 v0.4.1 to dependencies. diff --git a/crates/cargo-add/tests/snapshots/add/overwrite_no_default_features.stdout b/crates/cargo-add/tests/snapshots/add/overwrite_no_default_features.stdout new file mode 100644 index 0000000000..e69de29bb2 diff --git a/crates/cargo-add/tests/cmd/add/overwrite_no_default_features.out/Cargo.toml b/crates/cargo-add/tests/snapshots/add/overwrite_no_default_features_with_default_features.in/Cargo.toml similarity index 94% rename from crates/cargo-add/tests/cmd/add/overwrite_no_default_features.out/Cargo.toml rename to crates/cargo-add/tests/snapshots/add/overwrite_no_default_features_with_default_features.in/Cargo.toml index 1b18e65275..ddd02b1f05 100644 --- a/crates/cargo-add/tests/cmd/add/overwrite_no_default_features.out/Cargo.toml +++ b/crates/cargo-add/tests/snapshots/add/overwrite_no_default_features_with_default_features.in/Cargo.toml @@ -1,3 +1,5 @@ +[workspace] + [package] name = "cargo-list-test-fixture" version = "0.0.0" diff --git a/crates/cargo-add/tests/snapshots/add/overwrite_no_default_features_with_default_features.in/src/lib.rs b/crates/cargo-add/tests/snapshots/add/overwrite_no_default_features_with_default_features.in/src/lib.rs new file mode 100644 index 0000000000..e69de29bb2 diff --git a/crates/cargo-add/tests/cmd/add/overwrite_no_default_features_with_default_features.out/Cargo.toml b/crates/cargo-add/tests/snapshots/add/overwrite_no_default_features_with_default_features.out/Cargo.toml similarity index 92% rename from crates/cargo-add/tests/cmd/add/overwrite_no_default_features_with_default_features.out/Cargo.toml rename to crates/cargo-add/tests/snapshots/add/overwrite_no_default_features_with_default_features.out/Cargo.toml index bf3fdd54b7..b9e8985c6d 100644 --- a/crates/cargo-add/tests/cmd/add/overwrite_no_default_features_with_default_features.out/Cargo.toml +++ b/crates/cargo-add/tests/snapshots/add/overwrite_no_default_features_with_default_features.out/Cargo.toml @@ -1,3 +1,5 @@ +[workspace] + [package] name = "cargo-list-test-fixture" version = "0.0.0" diff --git a/crates/cargo-add/tests/snapshots/add/overwrite_no_default_features_with_default_features.stderr b/crates/cargo-add/tests/snapshots/add/overwrite_no_default_features_with_default_features.stderr new file mode 100644 index 0000000000..34a94b2539 --- /dev/null +++ b/crates/cargo-add/tests/snapshots/add/overwrite_no_default_features_with_default_features.stderr @@ -0,0 +1,3 @@ + Updating '[ROOTURL]/registry' index + Adding my-package1 v99999.0.0 to dependencies. + Adding my-package2 v0.4.1 to dependencies. diff --git a/crates/cargo-add/tests/snapshots/add/overwrite_no_default_features_with_default_features.stdout b/crates/cargo-add/tests/snapshots/add/overwrite_no_default_features_with_default_features.stdout new file mode 100644 index 0000000000..e69de29bb2 diff --git a/crates/cargo-add/tests/snapshots/add/overwrite_no_optional.in/Cargo.toml b/crates/cargo-add/tests/snapshots/add/overwrite_no_optional.in/Cargo.toml new file mode 100644 index 0000000000..c5e0178928 --- /dev/null +++ b/crates/cargo-add/tests/snapshots/add/overwrite_no_optional.in/Cargo.toml @@ -0,0 +1,9 @@ +[workspace] + +[package] +name = "cargo-list-test-fixture" +version = "0.0.0" + +[dependencies] +my-package1 = "99999.0.0" +my-package2 = "0.4.1" diff --git a/crates/cargo-add/tests/snapshots/add/overwrite_no_optional.in/src/lib.rs b/crates/cargo-add/tests/snapshots/add/overwrite_no_optional.in/src/lib.rs new file mode 100644 index 0000000000..e69de29bb2 diff --git a/crates/cargo-add/tests/snapshots/add/overwrite_no_optional.out/Cargo.toml b/crates/cargo-add/tests/snapshots/add/overwrite_no_optional.out/Cargo.toml new file mode 100644 index 0000000000..c5e0178928 --- /dev/null +++ b/crates/cargo-add/tests/snapshots/add/overwrite_no_optional.out/Cargo.toml @@ -0,0 +1,9 @@ +[workspace] + +[package] +name = "cargo-list-test-fixture" +version = "0.0.0" + +[dependencies] +my-package1 = "99999.0.0" +my-package2 = "0.4.1" diff --git a/crates/cargo-add/tests/snapshots/add/overwrite_no_optional.stderr b/crates/cargo-add/tests/snapshots/add/overwrite_no_optional.stderr new file mode 100644 index 0000000000..34a94b2539 --- /dev/null +++ b/crates/cargo-add/tests/snapshots/add/overwrite_no_optional.stderr @@ -0,0 +1,3 @@ + Updating '[ROOTURL]/registry' index + Adding my-package1 v99999.0.0 to dependencies. + Adding my-package2 v0.4.1 to dependencies. diff --git a/crates/cargo-add/tests/snapshots/add/overwrite_no_optional.stdout b/crates/cargo-add/tests/snapshots/add/overwrite_no_optional.stdout new file mode 100644 index 0000000000..e69de29bb2 diff --git a/crates/cargo-add/tests/cmd/add/overwrite_no_optional_with_optional.in/Cargo.toml b/crates/cargo-add/tests/snapshots/add/overwrite_no_optional_with_optional.in/Cargo.toml similarity index 93% rename from crates/cargo-add/tests/cmd/add/overwrite_no_optional_with_optional.in/Cargo.toml rename to crates/cargo-add/tests/snapshots/add/overwrite_no_optional_with_optional.in/Cargo.toml index ab8013cd22..8cd2616d4e 100644 --- a/crates/cargo-add/tests/cmd/add/overwrite_no_optional_with_optional.in/Cargo.toml +++ b/crates/cargo-add/tests/snapshots/add/overwrite_no_optional_with_optional.in/Cargo.toml @@ -1,3 +1,5 @@ +[workspace] + [package] name = "cargo-list-test-fixture" version = "0.0.0" diff --git a/crates/cargo-add/tests/snapshots/add/overwrite_no_optional_with_optional.in/src/lib.rs b/crates/cargo-add/tests/snapshots/add/overwrite_no_optional_with_optional.in/src/lib.rs new file mode 100644 index 0000000000..e69de29bb2 diff --git a/crates/cargo-add/tests/cmd/add/overwrite_no_optional_with_optional.out/Cargo.toml b/crates/cargo-add/tests/snapshots/add/overwrite_no_optional_with_optional.out/Cargo.toml similarity index 93% rename from crates/cargo-add/tests/cmd/add/overwrite_no_optional_with_optional.out/Cargo.toml rename to crates/cargo-add/tests/snapshots/add/overwrite_no_optional_with_optional.out/Cargo.toml index 9276b728fe..eda5445c50 100644 --- a/crates/cargo-add/tests/cmd/add/overwrite_no_optional_with_optional.out/Cargo.toml +++ b/crates/cargo-add/tests/snapshots/add/overwrite_no_optional_with_optional.out/Cargo.toml @@ -1,3 +1,5 @@ +[workspace] + [package] name = "cargo-list-test-fixture" version = "0.0.0" diff --git a/crates/cargo-add/tests/snapshots/add/overwrite_no_optional_with_optional.stderr b/crates/cargo-add/tests/snapshots/add/overwrite_no_optional_with_optional.stderr new file mode 100644 index 0000000000..ce269cf2bd --- /dev/null +++ b/crates/cargo-add/tests/snapshots/add/overwrite_no_optional_with_optional.stderr @@ -0,0 +1,3 @@ + Updating '[ROOTURL]/registry' index + Adding my-package1 v99999.0.0 to optional dependencies. + Adding my-package2 v0.4.1 to optional dependencies. diff --git a/crates/cargo-add/tests/snapshots/add/overwrite_no_optional_with_optional.stdout b/crates/cargo-add/tests/snapshots/add/overwrite_no_optional_with_optional.stdout new file mode 100644 index 0000000000..e69de29bb2 diff --git a/crates/cargo-add/tests/snapshots/add/overwrite_optional.in/Cargo.toml b/crates/cargo-add/tests/snapshots/add/overwrite_optional.in/Cargo.toml new file mode 100644 index 0000000000..c5e0178928 --- /dev/null +++ b/crates/cargo-add/tests/snapshots/add/overwrite_optional.in/Cargo.toml @@ -0,0 +1,9 @@ +[workspace] + +[package] +name = "cargo-list-test-fixture" +version = "0.0.0" + +[dependencies] +my-package1 = "99999.0.0" +my-package2 = "0.4.1" diff --git a/crates/cargo-add/tests/snapshots/add/overwrite_optional.in/src/lib.rs b/crates/cargo-add/tests/snapshots/add/overwrite_optional.in/src/lib.rs new file mode 100644 index 0000000000..e69de29bb2 diff --git a/crates/cargo-add/tests/cmd/add/overwrite_optional.out/Cargo.toml b/crates/cargo-add/tests/snapshots/add/overwrite_optional.out/Cargo.toml similarity index 93% rename from crates/cargo-add/tests/cmd/add/overwrite_optional.out/Cargo.toml rename to crates/cargo-add/tests/snapshots/add/overwrite_optional.out/Cargo.toml index 9276b728fe..eda5445c50 100644 --- a/crates/cargo-add/tests/cmd/add/overwrite_optional.out/Cargo.toml +++ b/crates/cargo-add/tests/snapshots/add/overwrite_optional.out/Cargo.toml @@ -1,3 +1,5 @@ +[workspace] + [package] name = "cargo-list-test-fixture" version = "0.0.0" diff --git a/crates/cargo-add/tests/snapshots/add/overwrite_optional.stderr b/crates/cargo-add/tests/snapshots/add/overwrite_optional.stderr new file mode 100644 index 0000000000..ce269cf2bd --- /dev/null +++ b/crates/cargo-add/tests/snapshots/add/overwrite_optional.stderr @@ -0,0 +1,3 @@ + Updating '[ROOTURL]/registry' index + Adding my-package1 v99999.0.0 to optional dependencies. + Adding my-package2 v0.4.1 to optional dependencies. diff --git a/crates/cargo-add/tests/snapshots/add/overwrite_optional.stdout b/crates/cargo-add/tests/snapshots/add/overwrite_optional.stdout new file mode 100644 index 0000000000..e69de29bb2 diff --git a/crates/cargo-add/tests/cmd/add/overwrite_optional_with_no_optional.in/Cargo.toml b/crates/cargo-add/tests/snapshots/add/overwrite_optional_with_no_optional.in/Cargo.toml similarity index 95% rename from crates/cargo-add/tests/cmd/add/overwrite_optional_with_no_optional.in/Cargo.toml rename to crates/cargo-add/tests/snapshots/add/overwrite_optional_with_no_optional.in/Cargo.toml index ac2fb2dc61..195d5c7e06 100644 --- a/crates/cargo-add/tests/cmd/add/overwrite_optional_with_no_optional.in/Cargo.toml +++ b/crates/cargo-add/tests/snapshots/add/overwrite_optional_with_no_optional.in/Cargo.toml @@ -1,3 +1,5 @@ +[workspace] + [package] name = "cargo-list-test-fixture" version = "0.0.0" diff --git a/crates/cargo-add/tests/snapshots/add/overwrite_optional_with_no_optional.in/src/lib.rs b/crates/cargo-add/tests/snapshots/add/overwrite_optional_with_no_optional.in/src/lib.rs new file mode 100644 index 0000000000..e69de29bb2 diff --git a/crates/cargo-add/tests/cmd/add/overwrite_optional_with_no_optional.out/Cargo.toml b/crates/cargo-add/tests/snapshots/add/overwrite_optional_with_no_optional.out/Cargo.toml similarity index 94% rename from crates/cargo-add/tests/cmd/add/overwrite_optional_with_no_optional.out/Cargo.toml rename to crates/cargo-add/tests/snapshots/add/overwrite_optional_with_no_optional.out/Cargo.toml index c581594272..6301685d17 100644 --- a/crates/cargo-add/tests/cmd/add/overwrite_optional_with_no_optional.out/Cargo.toml +++ b/crates/cargo-add/tests/snapshots/add/overwrite_optional_with_no_optional.out/Cargo.toml @@ -1,3 +1,5 @@ +[workspace] + [package] name = "cargo-list-test-fixture" version = "0.0.0" diff --git a/crates/cargo-add/tests/snapshots/add/overwrite_optional_with_no_optional.stderr b/crates/cargo-add/tests/snapshots/add/overwrite_optional_with_no_optional.stderr new file mode 100644 index 0000000000..34a94b2539 --- /dev/null +++ b/crates/cargo-add/tests/snapshots/add/overwrite_optional_with_no_optional.stderr @@ -0,0 +1,3 @@ + Updating '[ROOTURL]/registry' index + Adding my-package1 v99999.0.0 to dependencies. + Adding my-package2 v0.4.1 to dependencies. diff --git a/crates/cargo-add/tests/snapshots/add/overwrite_optional_with_no_optional.stdout b/crates/cargo-add/tests/snapshots/add/overwrite_optional_with_no_optional.stdout new file mode 100644 index 0000000000..e69de29bb2 diff --git a/crates/cargo-add/tests/snapshots/add/overwrite_path_noop.in/Cargo.toml b/crates/cargo-add/tests/snapshots/add/overwrite_path_noop.in/Cargo.toml new file mode 100644 index 0000000000..6a6ac823fd --- /dev/null +++ b/crates/cargo-add/tests/snapshots/add/overwrite_path_noop.in/Cargo.toml @@ -0,0 +1,9 @@ +[workspace] +exclude = ["dependency"] + +[package] +name = "cargo-list-test-fixture" +version = "0.0.0" + +[dependencies] +cargo-list-test-fixture-dependency = { version = "0.0.0", path = "dependency", optional = true, default-features = false, features = ["one", "two"], registry = "alternative" } diff --git a/crates/cargo-add/tests/cmd/add/overwrite_path_noop.in/dependency/Cargo.toml b/crates/cargo-add/tests/snapshots/add/overwrite_path_noop.in/dependency/Cargo.toml similarity index 100% rename from crates/cargo-add/tests/cmd/add/overwrite_path_noop.in/dependency/Cargo.toml rename to crates/cargo-add/tests/snapshots/add/overwrite_path_noop.in/dependency/Cargo.toml diff --git a/crates/cargo-add/tests/snapshots/add/overwrite_path_noop.in/dependency/src/lib.rs b/crates/cargo-add/tests/snapshots/add/overwrite_path_noop.in/dependency/src/lib.rs new file mode 100644 index 0000000000..e69de29bb2 diff --git a/crates/cargo-add/tests/snapshots/add/overwrite_path_noop.in/src/lib.rs b/crates/cargo-add/tests/snapshots/add/overwrite_path_noop.in/src/lib.rs new file mode 100644 index 0000000000..e69de29bb2 diff --git a/crates/cargo-add/tests/snapshots/add/overwrite_path_noop.out/Cargo.toml b/crates/cargo-add/tests/snapshots/add/overwrite_path_noop.out/Cargo.toml new file mode 100644 index 0000000000..6a6ac823fd --- /dev/null +++ b/crates/cargo-add/tests/snapshots/add/overwrite_path_noop.out/Cargo.toml @@ -0,0 +1,9 @@ +[workspace] +exclude = ["dependency"] + +[package] +name = "cargo-list-test-fixture" +version = "0.0.0" + +[dependencies] +cargo-list-test-fixture-dependency = { version = "0.0.0", path = "dependency", optional = true, default-features = false, features = ["one", "two"], registry = "alternative" } diff --git a/crates/cargo-add/tests/cmd/add/overwrite_path_noop.out/dependency/Cargo.toml b/crates/cargo-add/tests/snapshots/add/overwrite_path_noop.out/dependency/Cargo.toml similarity index 100% rename from crates/cargo-add/tests/cmd/add/overwrite_path_noop.out/dependency/Cargo.toml rename to crates/cargo-add/tests/snapshots/add/overwrite_path_noop.out/dependency/Cargo.toml diff --git a/crates/cargo-add/tests/snapshots/add/overwrite_path_noop.stderr b/crates/cargo-add/tests/snapshots/add/overwrite_path_noop.stderr new file mode 100644 index 0000000000..8db5f6898c --- /dev/null +++ b/crates/cargo-add/tests/snapshots/add/overwrite_path_noop.stderr @@ -0,0 +1,6 @@ + Updating '[ROOTURL]/registry' index +warning: Unrecognized features: ["one", "two"] + Adding cargo-list-test-fixture-dependency (local) to optional dependencies. + Features: + + one + + two diff --git a/crates/cargo-add/tests/snapshots/add/overwrite_path_noop.stdout b/crates/cargo-add/tests/snapshots/add/overwrite_path_noop.stdout new file mode 100644 index 0000000000..e69de29bb2 diff --git a/crates/cargo-add/tests/cmd/add/overwrite_path_with_version.in/dependency/Cargo.toml b/crates/cargo-add/tests/snapshots/add/overwrite_path_with_version.in/dependency/Cargo.toml similarity index 100% rename from crates/cargo-add/tests/cmd/add/overwrite_path_with_version.in/dependency/Cargo.toml rename to crates/cargo-add/tests/snapshots/add/overwrite_path_with_version.in/dependency/Cargo.toml diff --git a/crates/cargo-add/tests/snapshots/add/overwrite_path_with_version.in/dependency/src/lib.rs b/crates/cargo-add/tests/snapshots/add/overwrite_path_with_version.in/dependency/src/lib.rs new file mode 100644 index 0000000000..e69de29bb2 diff --git a/crates/cargo-add/tests/cmd/add/overwrite_path_with_version.in/primary/Cargo.toml b/crates/cargo-add/tests/snapshots/add/overwrite_path_with_version.in/primary/Cargo.toml similarity index 100% rename from crates/cargo-add/tests/cmd/add/overwrite_path_with_version.in/primary/Cargo.toml rename to crates/cargo-add/tests/snapshots/add/overwrite_path_with_version.in/primary/Cargo.toml diff --git a/crates/cargo-add/tests/snapshots/add/overwrite_path_with_version.in/primary/src/lib.rs b/crates/cargo-add/tests/snapshots/add/overwrite_path_with_version.in/primary/src/lib.rs new file mode 100644 index 0000000000..e69de29bb2 diff --git a/crates/cargo-add/tests/cmd/add/overwrite_path_with_version.out/dependency/Cargo.toml b/crates/cargo-add/tests/snapshots/add/overwrite_path_with_version.out/dependency/Cargo.toml similarity index 100% rename from crates/cargo-add/tests/cmd/add/overwrite_path_with_version.out/dependency/Cargo.toml rename to crates/cargo-add/tests/snapshots/add/overwrite_path_with_version.out/dependency/Cargo.toml diff --git a/crates/cargo-add/tests/cmd/add/overwrite_path_with_version.out/primary/Cargo.toml b/crates/cargo-add/tests/snapshots/add/overwrite_path_with_version.out/primary/Cargo.toml similarity index 100% rename from crates/cargo-add/tests/cmd/add/overwrite_path_with_version.out/primary/Cargo.toml rename to crates/cargo-add/tests/snapshots/add/overwrite_path_with_version.out/primary/Cargo.toml diff --git a/crates/cargo-add/tests/snapshots/add/overwrite_path_with_version.stderr b/crates/cargo-add/tests/snapshots/add/overwrite_path_with_version.stderr new file mode 100644 index 0000000000..7f5d8ea3b4 --- /dev/null +++ b/crates/cargo-add/tests/snapshots/add/overwrite_path_with_version.stderr @@ -0,0 +1,2 @@ + Updating '[ROOTURL]/registry' index + Adding cargo-list-test-fixture-dependency v20.0 to optional dependencies. diff --git a/crates/cargo-add/tests/snapshots/add/overwrite_path_with_version.stdout b/crates/cargo-add/tests/snapshots/add/overwrite_path_with_version.stdout new file mode 100644 index 0000000000..e69de29bb2 diff --git a/crates/cargo-add/tests/cmd/add/overwrite_rename_with_no_rename.in/Cargo.toml b/crates/cargo-add/tests/snapshots/add/overwrite_rename_with_no_rename.in/Cargo.toml similarity index 92% rename from crates/cargo-add/tests/cmd/add/overwrite_rename_with_no_rename.in/Cargo.toml rename to crates/cargo-add/tests/snapshots/add/overwrite_rename_with_no_rename.in/Cargo.toml index c3b6c50e0b..4502292454 100644 --- a/crates/cargo-add/tests/cmd/add/overwrite_rename_with_no_rename.in/Cargo.toml +++ b/crates/cargo-add/tests/snapshots/add/overwrite_rename_with_no_rename.in/Cargo.toml @@ -1,3 +1,5 @@ +[workspace] + [package] name = "cargo-list-test-fixture" version = "0.0.0" diff --git a/crates/cargo-add/tests/snapshots/add/overwrite_rename_with_no_rename.in/src/lib.rs b/crates/cargo-add/tests/snapshots/add/overwrite_rename_with_no_rename.in/src/lib.rs new file mode 100644 index 0000000000..e69de29bb2 diff --git a/crates/cargo-add/tests/cmd/add/overwrite_rename_with_no_rename.out/Cargo.toml b/crates/cargo-add/tests/snapshots/add/overwrite_rename_with_no_rename.out/Cargo.toml similarity index 93% rename from crates/cargo-add/tests/cmd/add/overwrite_rename_with_no_rename.out/Cargo.toml rename to crates/cargo-add/tests/snapshots/add/overwrite_rename_with_no_rename.out/Cargo.toml index 5ffb126220..9951492da9 100644 --- a/crates/cargo-add/tests/cmd/add/overwrite_rename_with_no_rename.out/Cargo.toml +++ b/crates/cargo-add/tests/snapshots/add/overwrite_rename_with_no_rename.out/Cargo.toml @@ -1,3 +1,5 @@ +[workspace] + [package] name = "cargo-list-test-fixture" version = "0.0.0" diff --git a/crates/cargo-add/tests/snapshots/add/overwrite_rename_with_no_rename.stderr b/crates/cargo-add/tests/snapshots/add/overwrite_rename_with_no_rename.stderr new file mode 100644 index 0000000000..cb378d0c43 --- /dev/null +++ b/crates/cargo-add/tests/snapshots/add/overwrite_rename_with_no_rename.stderr @@ -0,0 +1,2 @@ + Updating '[ROOTURL]/registry' index + Adding versioned-package v99999.0.0 to dependencies. diff --git a/crates/cargo-add/tests/snapshots/add/overwrite_rename_with_no_rename.stdout b/crates/cargo-add/tests/snapshots/add/overwrite_rename_with_no_rename.stdout new file mode 100644 index 0000000000..e69de29bb2 diff --git a/crates/cargo-add/tests/cmd/add/overwrite_rename_with_rename_noop.out/Cargo.toml b/crates/cargo-add/tests/snapshots/add/overwrite_rename_with_rename.in/Cargo.toml similarity index 92% rename from crates/cargo-add/tests/cmd/add/overwrite_rename_with_rename_noop.out/Cargo.toml rename to crates/cargo-add/tests/snapshots/add/overwrite_rename_with_rename.in/Cargo.toml index c3b6c50e0b..4502292454 100644 --- a/crates/cargo-add/tests/cmd/add/overwrite_rename_with_rename_noop.out/Cargo.toml +++ b/crates/cargo-add/tests/snapshots/add/overwrite_rename_with_rename.in/Cargo.toml @@ -1,3 +1,5 @@ +[workspace] + [package] name = "cargo-list-test-fixture" version = "0.0.0" diff --git a/crates/cargo-add/tests/snapshots/add/overwrite_rename_with_rename.in/src/lib.rs b/crates/cargo-add/tests/snapshots/add/overwrite_rename_with_rename.in/src/lib.rs new file mode 100644 index 0000000000..e69de29bb2 diff --git a/crates/cargo-add/tests/cmd/add/overwrite_rename_with_rename.out/Cargo.toml b/crates/cargo-add/tests/snapshots/add/overwrite_rename_with_rename.out/Cargo.toml similarity index 94% rename from crates/cargo-add/tests/cmd/add/overwrite_rename_with_rename.out/Cargo.toml rename to crates/cargo-add/tests/snapshots/add/overwrite_rename_with_rename.out/Cargo.toml index 8648470e2c..790f6546cc 100644 --- a/crates/cargo-add/tests/cmd/add/overwrite_rename_with_rename.out/Cargo.toml +++ b/crates/cargo-add/tests/snapshots/add/overwrite_rename_with_rename.out/Cargo.toml @@ -1,3 +1,5 @@ +[workspace] + [package] name = "cargo-list-test-fixture" version = "0.0.0" diff --git a/crates/cargo-add/tests/snapshots/add/overwrite_rename_with_rename.stderr b/crates/cargo-add/tests/snapshots/add/overwrite_rename_with_rename.stderr new file mode 100644 index 0000000000..cb378d0c43 --- /dev/null +++ b/crates/cargo-add/tests/snapshots/add/overwrite_rename_with_rename.stderr @@ -0,0 +1,2 @@ + Updating '[ROOTURL]/registry' index + Adding versioned-package v99999.0.0 to dependencies. diff --git a/crates/cargo-add/tests/snapshots/add/overwrite_rename_with_rename.stdout b/crates/cargo-add/tests/snapshots/add/overwrite_rename_with_rename.stdout new file mode 100644 index 0000000000..e69de29bb2 diff --git a/crates/cargo-add/tests/cmd/add/overwrite_rename_with_rename.in/Cargo.toml b/crates/cargo-add/tests/snapshots/add/overwrite_rename_with_rename_noop.in/Cargo.toml similarity index 92% rename from crates/cargo-add/tests/cmd/add/overwrite_rename_with_rename.in/Cargo.toml rename to crates/cargo-add/tests/snapshots/add/overwrite_rename_with_rename_noop.in/Cargo.toml index c3b6c50e0b..4502292454 100644 --- a/crates/cargo-add/tests/cmd/add/overwrite_rename_with_rename.in/Cargo.toml +++ b/crates/cargo-add/tests/snapshots/add/overwrite_rename_with_rename_noop.in/Cargo.toml @@ -1,3 +1,5 @@ +[workspace] + [package] name = "cargo-list-test-fixture" version = "0.0.0" diff --git a/crates/cargo-add/tests/snapshots/add/overwrite_rename_with_rename_noop.in/src/lib.rs b/crates/cargo-add/tests/snapshots/add/overwrite_rename_with_rename_noop.in/src/lib.rs new file mode 100644 index 0000000000..e69de29bb2 diff --git a/crates/cargo-add/tests/cmd/add/overwrite_rename_with_rename_noop.in/Cargo.toml b/crates/cargo-add/tests/snapshots/add/overwrite_rename_with_rename_noop.out/Cargo.toml similarity index 92% rename from crates/cargo-add/tests/cmd/add/overwrite_rename_with_rename_noop.in/Cargo.toml rename to crates/cargo-add/tests/snapshots/add/overwrite_rename_with_rename_noop.out/Cargo.toml index c3b6c50e0b..4502292454 100644 --- a/crates/cargo-add/tests/cmd/add/overwrite_rename_with_rename_noop.in/Cargo.toml +++ b/crates/cargo-add/tests/snapshots/add/overwrite_rename_with_rename_noop.out/Cargo.toml @@ -1,3 +1,5 @@ +[workspace] + [package] name = "cargo-list-test-fixture" version = "0.0.0" diff --git a/crates/cargo-add/tests/snapshots/add/overwrite_rename_with_rename_noop.stderr b/crates/cargo-add/tests/snapshots/add/overwrite_rename_with_rename_noop.stderr new file mode 100644 index 0000000000..17efb8a6d2 --- /dev/null +++ b/crates/cargo-add/tests/snapshots/add/overwrite_rename_with_rename_noop.stderr @@ -0,0 +1,2 @@ + Updating '[ROOTURL]/registry' index + Adding versioned-package v0.1.1 to optional dependencies. diff --git a/crates/cargo-add/tests/snapshots/add/overwrite_rename_with_rename_noop.stdout b/crates/cargo-add/tests/snapshots/add/overwrite_rename_with_rename_noop.stdout new file mode 100644 index 0000000000..e69de29bb2 diff --git a/crates/cargo-add/tests/cmd/add/overwrite_version_with_git.in/Cargo.toml b/crates/cargo-add/tests/snapshots/add/overwrite_version_with_git.in/Cargo.toml similarity index 91% rename from crates/cargo-add/tests/cmd/add/overwrite_version_with_git.in/Cargo.toml rename to crates/cargo-add/tests/snapshots/add/overwrite_version_with_git.in/Cargo.toml index 660b31284a..fe41f2a90b 100644 --- a/crates/cargo-add/tests/cmd/add/overwrite_version_with_git.in/Cargo.toml +++ b/crates/cargo-add/tests/snapshots/add/overwrite_version_with_git.in/Cargo.toml @@ -1,3 +1,5 @@ +[workspace] + [package] name = "cargo-list-test-fixture" version = "0.0.0" diff --git a/crates/cargo-add/tests/snapshots/add/overwrite_version_with_git.in/src/lib.rs b/crates/cargo-add/tests/snapshots/add/overwrite_version_with_git.in/src/lib.rs new file mode 100644 index 0000000000..e69de29bb2 diff --git a/crates/cargo-add/tests/cmd/add/overwrite_version_with_git.out/Cargo.toml b/crates/cargo-add/tests/snapshots/add/overwrite_version_with_git.out/Cargo.toml similarity index 91% rename from crates/cargo-add/tests/cmd/add/overwrite_version_with_git.out/Cargo.toml rename to crates/cargo-add/tests/snapshots/add/overwrite_version_with_git.out/Cargo.toml index e7e1afc272..20aaa38118 100644 --- a/crates/cargo-add/tests/cmd/add/overwrite_version_with_git.out/Cargo.toml +++ b/crates/cargo-add/tests/snapshots/add/overwrite_version_with_git.out/Cargo.toml @@ -1,3 +1,5 @@ +[workspace] + [package] name = "cargo-list-test-fixture" version = "0.0.0" diff --git a/crates/cargo-add/tests/snapshots/add/overwrite_version_with_git.stderr b/crates/cargo-add/tests/snapshots/add/overwrite_version_with_git.stderr new file mode 100644 index 0000000000..f2d253d90d --- /dev/null +++ b/crates/cargo-add/tests/snapshots/add/overwrite_version_with_git.stderr @@ -0,0 +1,2 @@ + Updating '[ROOTURL]/registry' index + Adding versioned-package (git) to optional dependencies. diff --git a/crates/cargo-add/tests/snapshots/add/overwrite_version_with_git.stdout b/crates/cargo-add/tests/snapshots/add/overwrite_version_with_git.stdout new file mode 100644 index 0000000000..e69de29bb2 diff --git a/crates/cargo-add/tests/cmd/add/overwrite_version_with_inline_path.in/dependency/Cargo.toml b/crates/cargo-add/tests/snapshots/add/overwrite_version_with_inline_path.in/dependency/Cargo.toml similarity index 100% rename from crates/cargo-add/tests/cmd/add/overwrite_version_with_inline_path.in/dependency/Cargo.toml rename to crates/cargo-add/tests/snapshots/add/overwrite_version_with_inline_path.in/dependency/Cargo.toml diff --git a/crates/cargo-add/tests/snapshots/add/overwrite_version_with_inline_path.in/dependency/src/lib.rs b/crates/cargo-add/tests/snapshots/add/overwrite_version_with_inline_path.in/dependency/src/lib.rs new file mode 100644 index 0000000000..e69de29bb2 diff --git a/crates/cargo-add/tests/cmd/add/overwrite_version_with_inline_path.in/primary/Cargo.toml b/crates/cargo-add/tests/snapshots/add/overwrite_version_with_inline_path.in/primary/Cargo.toml similarity index 100% rename from crates/cargo-add/tests/cmd/add/overwrite_version_with_inline_path.in/primary/Cargo.toml rename to crates/cargo-add/tests/snapshots/add/overwrite_version_with_inline_path.in/primary/Cargo.toml diff --git a/crates/cargo-add/tests/snapshots/add/overwrite_version_with_inline_path.in/primary/src/lib.rs b/crates/cargo-add/tests/snapshots/add/overwrite_version_with_inline_path.in/primary/src/lib.rs new file mode 100644 index 0000000000..e69de29bb2 diff --git a/crates/cargo-add/tests/cmd/add/overwrite_version_with_inline_path.out/dependency/Cargo.toml b/crates/cargo-add/tests/snapshots/add/overwrite_version_with_inline_path.out/dependency/Cargo.toml similarity index 100% rename from crates/cargo-add/tests/cmd/add/overwrite_version_with_inline_path.out/dependency/Cargo.toml rename to crates/cargo-add/tests/snapshots/add/overwrite_version_with_inline_path.out/dependency/Cargo.toml diff --git a/crates/cargo-add/tests/cmd/add/overwrite_version_with_inline_path.out/primary/Cargo.toml b/crates/cargo-add/tests/snapshots/add/overwrite_version_with_inline_path.out/primary/Cargo.toml similarity index 100% rename from crates/cargo-add/tests/cmd/add/overwrite_version_with_inline_path.out/primary/Cargo.toml rename to crates/cargo-add/tests/snapshots/add/overwrite_version_with_inline_path.out/primary/Cargo.toml diff --git a/crates/cargo-add/tests/snapshots/add/overwrite_version_with_inline_path.stderr b/crates/cargo-add/tests/snapshots/add/overwrite_version_with_inline_path.stderr new file mode 100644 index 0000000000..c1d8ae6584 --- /dev/null +++ b/crates/cargo-add/tests/snapshots/add/overwrite_version_with_inline_path.stderr @@ -0,0 +1,2 @@ + Updating '[ROOTURL]/registry' index + Adding cargo-list-test-fixture-dependency (local) to optional dependencies. diff --git a/crates/cargo-add/tests/snapshots/add/overwrite_version_with_inline_path.stdout b/crates/cargo-add/tests/snapshots/add/overwrite_version_with_inline_path.stdout new file mode 100644 index 0000000000..e69de29bb2 diff --git a/crates/cargo-add/tests/cmd/add/overwrite_with_rename.in/Cargo.toml b/crates/cargo-add/tests/snapshots/add/overwrite_with_rename.in/Cargo.toml similarity index 91% rename from crates/cargo-add/tests/cmd/add/overwrite_with_rename.in/Cargo.toml rename to crates/cargo-add/tests/snapshots/add/overwrite_with_rename.in/Cargo.toml index 660b31284a..fe41f2a90b 100644 --- a/crates/cargo-add/tests/cmd/add/overwrite_with_rename.in/Cargo.toml +++ b/crates/cargo-add/tests/snapshots/add/overwrite_with_rename.in/Cargo.toml @@ -1,3 +1,5 @@ +[workspace] + [package] name = "cargo-list-test-fixture" version = "0.0.0" diff --git a/crates/cargo-add/tests/snapshots/add/overwrite_with_rename.in/src/lib.rs b/crates/cargo-add/tests/snapshots/add/overwrite_with_rename.in/src/lib.rs new file mode 100644 index 0000000000..e69de29bb2 diff --git a/crates/cargo-add/tests/cmd/add/overwrite_with_rename.out/Cargo.toml b/crates/cargo-add/tests/snapshots/add/overwrite_with_rename.out/Cargo.toml similarity index 93% rename from crates/cargo-add/tests/cmd/add/overwrite_with_rename.out/Cargo.toml rename to crates/cargo-add/tests/snapshots/add/overwrite_with_rename.out/Cargo.toml index fdcd716952..4b74851811 100644 --- a/crates/cargo-add/tests/cmd/add/overwrite_with_rename.out/Cargo.toml +++ b/crates/cargo-add/tests/snapshots/add/overwrite_with_rename.out/Cargo.toml @@ -1,3 +1,5 @@ +[workspace] + [package] name = "cargo-list-test-fixture" version = "0.0.0" diff --git a/crates/cargo-add/tests/snapshots/add/overwrite_with_rename.stderr b/crates/cargo-add/tests/snapshots/add/overwrite_with_rename.stderr new file mode 100644 index 0000000000..cb378d0c43 --- /dev/null +++ b/crates/cargo-add/tests/snapshots/add/overwrite_with_rename.stderr @@ -0,0 +1,2 @@ + Updating '[ROOTURL]/registry' index + Adding versioned-package v99999.0.0 to dependencies. diff --git a/crates/cargo-add/tests/snapshots/add/overwrite_with_rename.stdout b/crates/cargo-add/tests/snapshots/add/overwrite_with_rename.stdout new file mode 100644 index 0000000000..e69de29bb2 diff --git a/crates/cargo-add/tests/cmd/add/preserve_sorted.in/Cargo.toml b/crates/cargo-add/tests/snapshots/add/preserve_sorted.in/Cargo.toml similarity index 89% rename from crates/cargo-add/tests/cmd/add/preserve_sorted.in/Cargo.toml rename to crates/cargo-add/tests/snapshots/add/preserve_sorted.in/Cargo.toml index ea6deaacb3..2716d64788 100644 --- a/crates/cargo-add/tests/cmd/add/preserve_sorted.in/Cargo.toml +++ b/crates/cargo-add/tests/snapshots/add/preserve_sorted.in/Cargo.toml @@ -1,3 +1,5 @@ +[workspace] + [package] name = "cargo-list-test-fixture" version = "0.0.0" diff --git a/crates/cargo-add/tests/snapshots/add/preserve_sorted.in/src/lib.rs b/crates/cargo-add/tests/snapshots/add/preserve_sorted.in/src/lib.rs new file mode 100644 index 0000000000..e69de29bb2 diff --git a/crates/cargo-add/tests/cmd/add/preserve_sorted.out/Cargo.toml b/crates/cargo-add/tests/snapshots/add/preserve_sorted.out/Cargo.toml similarity index 91% rename from crates/cargo-add/tests/cmd/add/preserve_sorted.out/Cargo.toml rename to crates/cargo-add/tests/snapshots/add/preserve_sorted.out/Cargo.toml index 4559655a21..88222bd2a2 100644 --- a/crates/cargo-add/tests/cmd/add/preserve_sorted.out/Cargo.toml +++ b/crates/cargo-add/tests/snapshots/add/preserve_sorted.out/Cargo.toml @@ -1,3 +1,5 @@ +[workspace] + [package] name = "cargo-list-test-fixture" version = "0.0.0" diff --git a/crates/cargo-add/tests/snapshots/add/preserve_sorted.stderr b/crates/cargo-add/tests/snapshots/add/preserve_sorted.stderr new file mode 100644 index 0000000000..8400c1a216 --- /dev/null +++ b/crates/cargo-add/tests/snapshots/add/preserve_sorted.stderr @@ -0,0 +1,2 @@ + Updating '[ROOTURL]/registry' index + Adding toml v99999.0.0 to dependencies. diff --git a/crates/cargo-add/tests/snapshots/add/preserve_sorted.stdout b/crates/cargo-add/tests/snapshots/add/preserve_sorted.stdout new file mode 100644 index 0000000000..e69de29bb2 diff --git a/crates/cargo-add/tests/cmd/add/preserve_unsorted.in/Cargo.toml b/crates/cargo-add/tests/snapshots/add/preserve_unsorted.in/Cargo.toml similarity index 76% rename from crates/cargo-add/tests/cmd/add/preserve_unsorted.in/Cargo.toml rename to crates/cargo-add/tests/snapshots/add/preserve_unsorted.in/Cargo.toml index 37be7b83fc..5957df98b6 100644 --- a/crates/cargo-add/tests/cmd/add/preserve_unsorted.in/Cargo.toml +++ b/crates/cargo-add/tests/snapshots/add/preserve_unsorted.in/Cargo.toml @@ -1,7 +1,9 @@ +[workspace] + [package] name = "cargo-list-test-fixture" version = "0.0.0" [dependencies] toml_edit = "0.1.5" -atty = "0.2.13" \ No newline at end of file +atty = "0.2.13" diff --git a/crates/cargo-add/tests/snapshots/add/preserve_unsorted.in/src/lib.rs b/crates/cargo-add/tests/snapshots/add/preserve_unsorted.in/src/lib.rs new file mode 100644 index 0000000000..e69de29bb2 diff --git a/crates/cargo-add/tests/cmd/add/preserve_unsorted.out/Cargo.toml b/crates/cargo-add/tests/snapshots/add/preserve_unsorted.out/Cargo.toml similarity index 91% rename from crates/cargo-add/tests/cmd/add/preserve_unsorted.out/Cargo.toml rename to crates/cargo-add/tests/snapshots/add/preserve_unsorted.out/Cargo.toml index 7812f0f463..e01b9255ec 100644 --- a/crates/cargo-add/tests/cmd/add/preserve_unsorted.out/Cargo.toml +++ b/crates/cargo-add/tests/snapshots/add/preserve_unsorted.out/Cargo.toml @@ -1,3 +1,5 @@ +[workspace] + [package] name = "cargo-list-test-fixture" version = "0.0.0" diff --git a/crates/cargo-add/tests/snapshots/add/preserve_unsorted.stderr b/crates/cargo-add/tests/snapshots/add/preserve_unsorted.stderr new file mode 100644 index 0000000000..8400c1a216 --- /dev/null +++ b/crates/cargo-add/tests/snapshots/add/preserve_unsorted.stderr @@ -0,0 +1,2 @@ + Updating '[ROOTURL]/registry' index + Adding toml v99999.0.0 to dependencies. diff --git a/crates/cargo-add/tests/snapshots/add/preserve_unsorted.stdout b/crates/cargo-add/tests/snapshots/add/preserve_unsorted.stdout new file mode 100644 index 0000000000..e69de29bb2 diff --git a/crates/cargo-add/tests/snapshots/add/registry.in/Cargo.toml b/crates/cargo-add/tests/snapshots/add/registry.in/Cargo.toml new file mode 100644 index 0000000000..3ecdb66816 --- /dev/null +++ b/crates/cargo-add/tests/snapshots/add/registry.in/Cargo.toml @@ -0,0 +1,5 @@ +[workspace] + +[package] +name = "cargo-list-test-fixture" +version = "0.0.0" diff --git a/crates/cargo-add/tests/snapshots/add/registry.in/src/lib.rs b/crates/cargo-add/tests/snapshots/add/registry.in/src/lib.rs new file mode 100644 index 0000000000..e69de29bb2 diff --git a/crates/cargo-add/tests/cmd/add/registry.out/Cargo.toml b/crates/cargo-add/tests/snapshots/add/registry.out/Cargo.toml similarity index 94% rename from crates/cargo-add/tests/cmd/add/registry.out/Cargo.toml rename to crates/cargo-add/tests/snapshots/add/registry.out/Cargo.toml index e9ae5b2dbb..e856bee5df 100644 --- a/crates/cargo-add/tests/cmd/add/registry.out/Cargo.toml +++ b/crates/cargo-add/tests/snapshots/add/registry.out/Cargo.toml @@ -1,3 +1,5 @@ +[workspace] + [package] name = "cargo-list-test-fixture" version = "0.0.0" diff --git a/crates/cargo-add/tests/snapshots/add/registry.stderr b/crates/cargo-add/tests/snapshots/add/registry.stderr new file mode 100644 index 0000000000..69b1365a50 --- /dev/null +++ b/crates/cargo-add/tests/snapshots/add/registry.stderr @@ -0,0 +1,3 @@ + Updating '[ROOTURL]/alternative-registry' index + Adding my-package1 v99999.0.0 to dependencies. + Adding my-package2 v99999.0.0 to dependencies. diff --git a/crates/cargo-add/tests/snapshots/add/registry.stdout b/crates/cargo-add/tests/snapshots/add/registry.stdout new file mode 100644 index 0000000000..e69de29bb2 diff --git a/crates/cargo-add/tests/cmd/add/rename.in b/crates/cargo-add/tests/snapshots/add/rename.in similarity index 100% rename from crates/cargo-add/tests/cmd/add/rename.in rename to crates/cargo-add/tests/snapshots/add/rename.in diff --git a/crates/cargo-add/tests/cmd/add/rename.out/Cargo.toml b/crates/cargo-add/tests/snapshots/add/rename.out/Cargo.toml similarity index 91% rename from crates/cargo-add/tests/cmd/add/rename.out/Cargo.toml rename to crates/cargo-add/tests/snapshots/add/rename.out/Cargo.toml index f371b50f8a..ebcfbbd99d 100644 --- a/crates/cargo-add/tests/cmd/add/rename.out/Cargo.toml +++ b/crates/cargo-add/tests/snapshots/add/rename.out/Cargo.toml @@ -1,3 +1,5 @@ +[workspace] + [package] name = "cargo-list-test-fixture" version = "0.0.0" diff --git a/crates/cargo-add/tests/snapshots/add/rename.stderr b/crates/cargo-add/tests/snapshots/add/rename.stderr new file mode 100644 index 0000000000..ac08493cd5 --- /dev/null +++ b/crates/cargo-add/tests/snapshots/add/rename.stderr @@ -0,0 +1,2 @@ + Updating '[ROOTURL]/registry' index + Adding my-package v99999.0.0 to dependencies. diff --git a/crates/cargo-add/tests/snapshots/add/rename.stdout b/crates/cargo-add/tests/snapshots/add/rename.stdout new file mode 100644 index 0000000000..e69de29bb2 diff --git a/crates/cargo-add/tests/cmd/add/target.in b/crates/cargo-add/tests/snapshots/add/target.in similarity index 100% rename from crates/cargo-add/tests/cmd/add/target.in rename to crates/cargo-add/tests/snapshots/add/target.in diff --git a/crates/cargo-add/tests/cmd/add/target.out/Cargo.toml b/crates/cargo-add/tests/snapshots/add/target.out/Cargo.toml similarity index 93% rename from crates/cargo-add/tests/cmd/add/target.out/Cargo.toml rename to crates/cargo-add/tests/snapshots/add/target.out/Cargo.toml index e39d4e94a6..f366f028f9 100644 --- a/crates/cargo-add/tests/cmd/add/target.out/Cargo.toml +++ b/crates/cargo-add/tests/snapshots/add/target.out/Cargo.toml @@ -1,3 +1,5 @@ +[workspace] + [package] name = "cargo-list-test-fixture" version = "0.0.0" diff --git a/crates/cargo-add/tests/snapshots/add/target.stderr b/crates/cargo-add/tests/snapshots/add/target.stderr new file mode 100644 index 0000000000..5e5427ff5a --- /dev/null +++ b/crates/cargo-add/tests/snapshots/add/target.stderr @@ -0,0 +1,3 @@ + Updating '[ROOTURL]/registry' index + Adding my-package1 v99999.0.0 to dependencies for target `i686-unknown-linux-gnu`. + Adding my-package2 v99999.0.0 to dependencies for target `i686-unknown-linux-gnu`. diff --git a/crates/cargo-add/tests/snapshots/add/target.stdout b/crates/cargo-add/tests/snapshots/add/target.stdout new file mode 100644 index 0000000000..e69de29bb2 diff --git a/crates/cargo-add/tests/cmd/add/target_cfg.in b/crates/cargo-add/tests/snapshots/add/target_cfg.in similarity index 100% rename from crates/cargo-add/tests/cmd/add/target_cfg.in rename to crates/cargo-add/tests/snapshots/add/target_cfg.in diff --git a/crates/cargo-add/tests/cmd/add/target_cfg.out/Cargo.toml b/crates/cargo-add/tests/snapshots/add/target_cfg.out/Cargo.toml similarity index 93% rename from crates/cargo-add/tests/cmd/add/target_cfg.out/Cargo.toml rename to crates/cargo-add/tests/snapshots/add/target_cfg.out/Cargo.toml index 344ce01250..910af3ba1e 100644 --- a/crates/cargo-add/tests/cmd/add/target_cfg.out/Cargo.toml +++ b/crates/cargo-add/tests/snapshots/add/target_cfg.out/Cargo.toml @@ -1,3 +1,5 @@ +[workspace] + [package] name = "cargo-list-test-fixture" version = "0.0.0" diff --git a/crates/cargo-add/tests/snapshots/add/target_cfg.stderr b/crates/cargo-add/tests/snapshots/add/target_cfg.stderr new file mode 100644 index 0000000000..d1fd104b21 --- /dev/null +++ b/crates/cargo-add/tests/snapshots/add/target_cfg.stderr @@ -0,0 +1,3 @@ + Updating '[ROOTURL]/registry' index + Adding my-package1 v99999.0.0 to dependencies for target `cfg(unix)`. + Adding my-package2 v99999.0.0 to dependencies for target `cfg(unix)`. diff --git a/crates/cargo-add/tests/snapshots/add/target_cfg.stdout b/crates/cargo-add/tests/snapshots/add/target_cfg.stdout new file mode 100644 index 0000000000..e69de29bb2 diff --git a/crates/cargo-add/tests/cmd/add/vers.in b/crates/cargo-add/tests/snapshots/add/vers.in similarity index 100% rename from crates/cargo-add/tests/cmd/add/vers.in rename to crates/cargo-add/tests/snapshots/add/vers.in diff --git a/crates/cargo-add/tests/cmd/add/vers.out/Cargo.toml b/crates/cargo-add/tests/snapshots/add/vers.out/Cargo.toml similarity index 88% rename from crates/cargo-add/tests/cmd/add/vers.out/Cargo.toml rename to crates/cargo-add/tests/snapshots/add/vers.out/Cargo.toml index 5d430896bb..c6ca3d67af 100644 --- a/crates/cargo-add/tests/cmd/add/vers.out/Cargo.toml +++ b/crates/cargo-add/tests/snapshots/add/vers.out/Cargo.toml @@ -1,3 +1,5 @@ +[workspace] + [package] name = "cargo-list-test-fixture" version = "0.0.0" diff --git a/crates/cargo-add/tests/snapshots/add/vers.stderr b/crates/cargo-add/tests/snapshots/add/vers.stderr new file mode 100644 index 0000000000..bc7f35ccac --- /dev/null +++ b/crates/cargo-add/tests/snapshots/add/vers.stderr @@ -0,0 +1,2 @@ + Updating '[ROOTURL]/registry' index + Adding my-package >=0.1.1 to dependencies. diff --git a/crates/cargo-add/tests/snapshots/add/vers.stdout b/crates/cargo-add/tests/snapshots/add/vers.stdout new file mode 100644 index 0000000000..e69de29bb2 diff --git a/crates/cargo-add/tests/cmd/add/workspace_inline_path.in/Cargo.toml b/crates/cargo-add/tests/snapshots/add/workspace_inline_path.in/Cargo.toml similarity index 100% rename from crates/cargo-add/tests/cmd/add/workspace_inline_path.in/Cargo.toml rename to crates/cargo-add/tests/snapshots/add/workspace_inline_path.in/Cargo.toml diff --git a/crates/cargo-add/tests/cmd/add/workspace_inline_path.in/dependency/Cargo.toml b/crates/cargo-add/tests/snapshots/add/workspace_inline_path.in/dependency/Cargo.toml similarity index 100% rename from crates/cargo-add/tests/cmd/add/workspace_inline_path.in/dependency/Cargo.toml rename to crates/cargo-add/tests/snapshots/add/workspace_inline_path.in/dependency/Cargo.toml diff --git a/crates/cargo-add/tests/snapshots/add/workspace_inline_path.in/dependency/src/lib.rs b/crates/cargo-add/tests/snapshots/add/workspace_inline_path.in/dependency/src/lib.rs new file mode 100644 index 0000000000..e69de29bb2 diff --git a/crates/cargo-add/tests/cmd/add/git_conflicts_namever.out/Cargo.toml b/crates/cargo-add/tests/snapshots/add/workspace_inline_path.in/primary/Cargo.toml similarity index 100% rename from crates/cargo-add/tests/cmd/add/git_conflicts_namever.out/Cargo.toml rename to crates/cargo-add/tests/snapshots/add/workspace_inline_path.in/primary/Cargo.toml diff --git a/crates/cargo-add/tests/snapshots/add/workspace_inline_path.in/primary/src/lib.rs b/crates/cargo-add/tests/snapshots/add/workspace_inline_path.in/primary/src/lib.rs new file mode 100644 index 0000000000..e69de29bb2 diff --git a/crates/cargo-add/tests/cmd/add/workspace_inline_path.out/Cargo.toml b/crates/cargo-add/tests/snapshots/add/workspace_inline_path.out/Cargo.toml similarity index 100% rename from crates/cargo-add/tests/cmd/add/workspace_inline_path.out/Cargo.toml rename to crates/cargo-add/tests/snapshots/add/workspace_inline_path.out/Cargo.toml diff --git a/crates/cargo-add/tests/cmd/add/workspace_inline_path.out/dependency/Cargo.toml b/crates/cargo-add/tests/snapshots/add/workspace_inline_path.out/dependency/Cargo.toml similarity index 100% rename from crates/cargo-add/tests/cmd/add/workspace_inline_path.out/dependency/Cargo.toml rename to crates/cargo-add/tests/snapshots/add/workspace_inline_path.out/dependency/Cargo.toml diff --git a/crates/cargo-add/tests/cmd/add/workspace_inline_path.out/primary/Cargo.toml b/crates/cargo-add/tests/snapshots/add/workspace_inline_path.out/primary/Cargo.toml similarity index 100% rename from crates/cargo-add/tests/cmd/add/workspace_inline_path.out/primary/Cargo.toml rename to crates/cargo-add/tests/snapshots/add/workspace_inline_path.out/primary/Cargo.toml diff --git a/crates/cargo-add/tests/snapshots/add/workspace_inline_path.stderr b/crates/cargo-add/tests/snapshots/add/workspace_inline_path.stderr new file mode 100644 index 0000000000..0790f5dd1d --- /dev/null +++ b/crates/cargo-add/tests/snapshots/add/workspace_inline_path.stderr @@ -0,0 +1,2 @@ + Updating '[ROOTURL]/registry' index + Adding cargo-list-test-fixture-dependency (local) to dependencies. diff --git a/crates/cargo-add/tests/snapshots/add/workspace_inline_path.stdout b/crates/cargo-add/tests/snapshots/add/workspace_inline_path.stdout new file mode 100644 index 0000000000..e69de29bb2 diff --git a/crates/cargo-add/tests/cmd/add/workspace_inline_path_dev.in/Cargo.toml b/crates/cargo-add/tests/snapshots/add/workspace_inline_path_dev.in/Cargo.toml similarity index 100% rename from crates/cargo-add/tests/cmd/add/workspace_inline_path_dev.in/Cargo.toml rename to crates/cargo-add/tests/snapshots/add/workspace_inline_path_dev.in/Cargo.toml diff --git a/crates/cargo-add/tests/cmd/add/workspace_inline_path_dev.in/dependency/Cargo.toml b/crates/cargo-add/tests/snapshots/add/workspace_inline_path_dev.in/dependency/Cargo.toml similarity index 100% rename from crates/cargo-add/tests/cmd/add/workspace_inline_path_dev.in/dependency/Cargo.toml rename to crates/cargo-add/tests/snapshots/add/workspace_inline_path_dev.in/dependency/Cargo.toml diff --git a/crates/cargo-add/tests/snapshots/add/workspace_inline_path_dev.in/dependency/src/lib.rs b/crates/cargo-add/tests/snapshots/add/workspace_inline_path_dev.in/dependency/src/lib.rs new file mode 100644 index 0000000000..e69de29bb2 diff --git a/crates/cargo-add/tests/cmd/add/git_conflicts_registry.out/Cargo.toml b/crates/cargo-add/tests/snapshots/add/workspace_inline_path_dev.in/primary/Cargo.toml similarity index 100% rename from crates/cargo-add/tests/cmd/add/git_conflicts_registry.out/Cargo.toml rename to crates/cargo-add/tests/snapshots/add/workspace_inline_path_dev.in/primary/Cargo.toml diff --git a/crates/cargo-add/tests/snapshots/add/workspace_inline_path_dev.in/primary/src/lib.rs b/crates/cargo-add/tests/snapshots/add/workspace_inline_path_dev.in/primary/src/lib.rs new file mode 100644 index 0000000000..e69de29bb2 diff --git a/crates/cargo-add/tests/cmd/add/workspace_inline_path_dev.out/Cargo.toml b/crates/cargo-add/tests/snapshots/add/workspace_inline_path_dev.out/Cargo.toml similarity index 100% rename from crates/cargo-add/tests/cmd/add/workspace_inline_path_dev.out/Cargo.toml rename to crates/cargo-add/tests/snapshots/add/workspace_inline_path_dev.out/Cargo.toml diff --git a/crates/cargo-add/tests/cmd/add/workspace_inline_path_dev.out/dependency/Cargo.toml b/crates/cargo-add/tests/snapshots/add/workspace_inline_path_dev.out/dependency/Cargo.toml similarity index 100% rename from crates/cargo-add/tests/cmd/add/workspace_inline_path_dev.out/dependency/Cargo.toml rename to crates/cargo-add/tests/snapshots/add/workspace_inline_path_dev.out/dependency/Cargo.toml diff --git a/crates/cargo-add/tests/cmd/add/workspace_inline_path_dev.out/primary/Cargo.toml b/crates/cargo-add/tests/snapshots/add/workspace_inline_path_dev.out/primary/Cargo.toml similarity index 100% rename from crates/cargo-add/tests/cmd/add/workspace_inline_path_dev.out/primary/Cargo.toml rename to crates/cargo-add/tests/snapshots/add/workspace_inline_path_dev.out/primary/Cargo.toml diff --git a/crates/cargo-add/tests/snapshots/add/workspace_inline_path_dev.stderr b/crates/cargo-add/tests/snapshots/add/workspace_inline_path_dev.stderr new file mode 100644 index 0000000000..b9cd9cb68c --- /dev/null +++ b/crates/cargo-add/tests/snapshots/add/workspace_inline_path_dev.stderr @@ -0,0 +1,2 @@ + Updating '[ROOTURL]/registry' index + Adding cargo-list-test-fixture-dependency (local) to dev-dependencies. diff --git a/crates/cargo-add/tests/snapshots/add/workspace_inline_path_dev.stdout b/crates/cargo-add/tests/snapshots/add/workspace_inline_path_dev.stdout new file mode 100644 index 0000000000..e69de29bb2 diff --git a/crates/cargo-add/tests/cmd/add/workspace_name.in/Cargo.toml b/crates/cargo-add/tests/snapshots/add/workspace_name.in/Cargo.toml similarity index 100% rename from crates/cargo-add/tests/cmd/add/workspace_name.in/Cargo.toml rename to crates/cargo-add/tests/snapshots/add/workspace_name.in/Cargo.toml diff --git a/crates/cargo-add/tests/cmd/add/workspace_name.in/dependency/Cargo.toml b/crates/cargo-add/tests/snapshots/add/workspace_name.in/dependency/Cargo.toml similarity index 100% rename from crates/cargo-add/tests/cmd/add/workspace_name.in/dependency/Cargo.toml rename to crates/cargo-add/tests/snapshots/add/workspace_name.in/dependency/Cargo.toml diff --git a/crates/cargo-add/tests/snapshots/add/workspace_name.in/dependency/src/lib.rs b/crates/cargo-add/tests/snapshots/add/workspace_name.in/dependency/src/lib.rs new file mode 100644 index 0000000000..e69de29bb2 diff --git a/crates/cargo-add/tests/cmd/add/invalid_arg.out/Cargo.toml b/crates/cargo-add/tests/snapshots/add/workspace_name.in/primary/Cargo.toml similarity index 100% rename from crates/cargo-add/tests/cmd/add/invalid_arg.out/Cargo.toml rename to crates/cargo-add/tests/snapshots/add/workspace_name.in/primary/Cargo.toml diff --git a/crates/cargo-add/tests/snapshots/add/workspace_name.in/primary/src/lib.rs b/crates/cargo-add/tests/snapshots/add/workspace_name.in/primary/src/lib.rs new file mode 100644 index 0000000000..e69de29bb2 diff --git a/crates/cargo-add/tests/cmd/add/workspace_name.out/Cargo.toml b/crates/cargo-add/tests/snapshots/add/workspace_name.out/Cargo.toml similarity index 100% rename from crates/cargo-add/tests/cmd/add/workspace_name.out/Cargo.toml rename to crates/cargo-add/tests/snapshots/add/workspace_name.out/Cargo.toml diff --git a/crates/cargo-add/tests/cmd/add/workspace_name.out/dependency/Cargo.toml b/crates/cargo-add/tests/snapshots/add/workspace_name.out/dependency/Cargo.toml similarity index 100% rename from crates/cargo-add/tests/cmd/add/workspace_name.out/dependency/Cargo.toml rename to crates/cargo-add/tests/snapshots/add/workspace_name.out/dependency/Cargo.toml diff --git a/crates/cargo-add/tests/cmd/add/workspace_name.out/primary/Cargo.toml b/crates/cargo-add/tests/snapshots/add/workspace_name.out/primary/Cargo.toml similarity index 100% rename from crates/cargo-add/tests/cmd/add/workspace_name.out/primary/Cargo.toml rename to crates/cargo-add/tests/snapshots/add/workspace_name.out/primary/Cargo.toml diff --git a/crates/cargo-add/tests/snapshots/add/workspace_name.stderr b/crates/cargo-add/tests/snapshots/add/workspace_name.stderr new file mode 100644 index 0000000000..0790f5dd1d --- /dev/null +++ b/crates/cargo-add/tests/snapshots/add/workspace_name.stderr @@ -0,0 +1,2 @@ + Updating '[ROOTURL]/registry' index + Adding cargo-list-test-fixture-dependency (local) to dependencies. diff --git a/crates/cargo-add/tests/snapshots/add/workspace_name.stdout b/crates/cargo-add/tests/snapshots/add/workspace_name.stdout new file mode 100644 index 0000000000..e69de29bb2 diff --git a/crates/cargo-add/tests/cmd/copy.sh b/crates/cargo-add/tests/snapshots/copy.sh similarity index 95% rename from crates/cargo-add/tests/cmd/copy.sh rename to crates/cargo-add/tests/snapshots/copy.sh index da66cb4aae..d39c2472d5 100755 --- a/crates/cargo-add/tests/cmd/copy.sh +++ b/crates/cargo-add/tests/snapshots/copy.sh @@ -10,7 +10,6 @@ if [ -z "${AFTER}" ]; then exit 1 fi -cp -r $1.toml $2.toml IN_LINK=$(readlink $1.in) if [ -n "${IN_LINK}" ]; then ln -s ${IN_LINK} $2.in diff --git a/crates/cargo-add/tests/cmd/rename.sh b/crates/cargo-add/tests/snapshots/rename.sh similarity index 94% rename from crates/cargo-add/tests/cmd/rename.sh rename to crates/cargo-add/tests/snapshots/rename.sh index f1f4fcac11..eae69fe2b5 100755 --- a/crates/cargo-add/tests/cmd/rename.sh +++ b/crates/cargo-add/tests/snapshots/rename.sh @@ -10,7 +10,6 @@ if [ -z "${AFTER}" ]; then exit 1 fi -mv $1.toml $2.toml mv $1.in $2.in mv $1.out $2.out if [ -e "$1.stdout" ]; then