From 199c82a96e24f2dba46b3f7748a1216952d68c80 Mon Sep 17 00:00:00 2001 From: alcolmenar Date: Fri, 4 Aug 2023 14:38:27 -0700 Subject: [PATCH] chore: add passing test --- .../invalid_gc_patch/in/Cargo.toml | 8 ++++++ .../invalid_gc_patch/in/serde/Cargo.toml | 9 +++++++ .../invalid_gc_patch/in/serde/src/lib.rs | 0 .../in/serde_derive/Cargo.toml | 8 ++++++ .../in/serde_derive/src/lib.rs | 0 .../cargo_remove/invalid_gc_patch/mod.rs | 27 +++++++++++++++++++ .../invalid_gc_patch/out/Cargo.toml | 5 ++++ .../invalid_gc_patch/out/serde/Cargo.toml | 6 +++++ .../invalid_gc_patch/out/serde/src/lib.rs | 0 .../out/serde_derive/Cargo.toml | 8 ++++++ .../out/serde_derive/src/lib.rs | 0 .../cargo_remove/invalid_gc_patch/stderr.log | 2 ++ .../cargo_remove/invalid_gc_patch/stdout.log | 0 tests/testsuite/cargo_remove/mod.rs | 1 + 14 files changed, 74 insertions(+) create mode 100644 tests/testsuite/cargo_remove/invalid_gc_patch/in/Cargo.toml create mode 100644 tests/testsuite/cargo_remove/invalid_gc_patch/in/serde/Cargo.toml create mode 100644 tests/testsuite/cargo_remove/invalid_gc_patch/in/serde/src/lib.rs create mode 100644 tests/testsuite/cargo_remove/invalid_gc_patch/in/serde_derive/Cargo.toml create mode 100644 tests/testsuite/cargo_remove/invalid_gc_patch/in/serde_derive/src/lib.rs create mode 100644 tests/testsuite/cargo_remove/invalid_gc_patch/mod.rs create mode 100644 tests/testsuite/cargo_remove/invalid_gc_patch/out/Cargo.toml create mode 100644 tests/testsuite/cargo_remove/invalid_gc_patch/out/serde/Cargo.toml create mode 100644 tests/testsuite/cargo_remove/invalid_gc_patch/out/serde/src/lib.rs create mode 100644 tests/testsuite/cargo_remove/invalid_gc_patch/out/serde_derive/Cargo.toml create mode 100644 tests/testsuite/cargo_remove/invalid_gc_patch/out/serde_derive/src/lib.rs create mode 100644 tests/testsuite/cargo_remove/invalid_gc_patch/stderr.log create mode 100644 tests/testsuite/cargo_remove/invalid_gc_patch/stdout.log diff --git a/tests/testsuite/cargo_remove/invalid_gc_patch/in/Cargo.toml b/tests/testsuite/cargo_remove/invalid_gc_patch/in/Cargo.toml new file mode 100644 index 000000000000..28b028417f78 --- /dev/null +++ b/tests/testsuite/cargo_remove/invalid_gc_patch/in/Cargo.toml @@ -0,0 +1,8 @@ +# Cargo.toml + +[workspace] +members = ["serde", "serde_derive"] + +[patch.crates-io] +serde = { path = "serde" } + diff --git a/tests/testsuite/cargo_remove/invalid_gc_patch/in/serde/Cargo.toml b/tests/testsuite/cargo_remove/invalid_gc_patch/in/serde/Cargo.toml new file mode 100644 index 000000000000..c05589abafa4 --- /dev/null +++ b/tests/testsuite/cargo_remove/invalid_gc_patch/in/serde/Cargo.toml @@ -0,0 +1,9 @@ +# serde/Cargo.toml + +[package] +name = "serde" +version = "1.0.0" + +[dependencies] +serde_derive = { path = "../serde_derive" } + diff --git a/tests/testsuite/cargo_remove/invalid_gc_patch/in/serde/src/lib.rs b/tests/testsuite/cargo_remove/invalid_gc_patch/in/serde/src/lib.rs new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/tests/testsuite/cargo_remove/invalid_gc_patch/in/serde_derive/Cargo.toml b/tests/testsuite/cargo_remove/invalid_gc_patch/in/serde_derive/Cargo.toml new file mode 100644 index 000000000000..2b9b48b50c56 --- /dev/null +++ b/tests/testsuite/cargo_remove/invalid_gc_patch/in/serde_derive/Cargo.toml @@ -0,0 +1,8 @@ +# serde_derive/Cargo.toml + +[package] +name = "serde_derive" +version = "1.0.0" + +[dev-dependencies] +serde_json = "1.0.0" diff --git a/tests/testsuite/cargo_remove/invalid_gc_patch/in/serde_derive/src/lib.rs b/tests/testsuite/cargo_remove/invalid_gc_patch/in/serde_derive/src/lib.rs new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/tests/testsuite/cargo_remove/invalid_gc_patch/mod.rs b/tests/testsuite/cargo_remove/invalid_gc_patch/mod.rs new file mode 100644 index 000000000000..f66478c5d0e5 --- /dev/null +++ b/tests/testsuite/cargo_remove/invalid_gc_patch/mod.rs @@ -0,0 +1,27 @@ +use cargo_test_support::compare::assert_ui; +use cargo_test_support::curr_dir; +use cargo_test_support::CargoCommand; +use cargo_test_support::Project; + +#[cargo_test] +fn case() { + cargo_test_support::registry::init(); + cargo_test_support::registry::Package::new("serde", "1.0.0").publish(); + cargo_test_support::registry::Package::new("serde_json", "1.0.0") + .dep("serde", "1.0.0") + .publish(); + + let project = Project::from_template(curr_dir!().join("in")); + let project_root = project.root(); + + snapbox::cmd::Command::cargo_ui() + .current_dir(&project_root) + .arg("remove") + .args(["--package", "serde", "serde_derive"]) + .assert() + .code(0) + .stdout_matches_path(curr_dir!().join("stdout.log")) + .stderr_matches_path(curr_dir!().join("stderr.log")); + + assert_ui().subset_matches(curr_dir!().join("out"), &project_root); +} diff --git a/tests/testsuite/cargo_remove/invalid_gc_patch/out/Cargo.toml b/tests/testsuite/cargo_remove/invalid_gc_patch/out/Cargo.toml new file mode 100644 index 000000000000..7070e0631d93 --- /dev/null +++ b/tests/testsuite/cargo_remove/invalid_gc_patch/out/Cargo.toml @@ -0,0 +1,5 @@ +# Cargo.toml + +[workspace] +members = ["serde", "serde_derive"] + diff --git a/tests/testsuite/cargo_remove/invalid_gc_patch/out/serde/Cargo.toml b/tests/testsuite/cargo_remove/invalid_gc_patch/out/serde/Cargo.toml new file mode 100644 index 000000000000..a91d8ebd58f0 --- /dev/null +++ b/tests/testsuite/cargo_remove/invalid_gc_patch/out/serde/Cargo.toml @@ -0,0 +1,6 @@ +# serde/Cargo.toml + +[package] +name = "serde" +version = "1.0.0" + diff --git a/tests/testsuite/cargo_remove/invalid_gc_patch/out/serde/src/lib.rs b/tests/testsuite/cargo_remove/invalid_gc_patch/out/serde/src/lib.rs new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/tests/testsuite/cargo_remove/invalid_gc_patch/out/serde_derive/Cargo.toml b/tests/testsuite/cargo_remove/invalid_gc_patch/out/serde_derive/Cargo.toml new file mode 100644 index 000000000000..2b9b48b50c56 --- /dev/null +++ b/tests/testsuite/cargo_remove/invalid_gc_patch/out/serde_derive/Cargo.toml @@ -0,0 +1,8 @@ +# serde_derive/Cargo.toml + +[package] +name = "serde_derive" +version = "1.0.0" + +[dev-dependencies] +serde_json = "1.0.0" diff --git a/tests/testsuite/cargo_remove/invalid_gc_patch/out/serde_derive/src/lib.rs b/tests/testsuite/cargo_remove/invalid_gc_patch/out/serde_derive/src/lib.rs new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/tests/testsuite/cargo_remove/invalid_gc_patch/stderr.log b/tests/testsuite/cargo_remove/invalid_gc_patch/stderr.log new file mode 100644 index 000000000000..abbc07834bbf --- /dev/null +++ b/tests/testsuite/cargo_remove/invalid_gc_patch/stderr.log @@ -0,0 +1,2 @@ + Removing serde_derive from dependencies + Updating `dummy-registry` index diff --git a/tests/testsuite/cargo_remove/invalid_gc_patch/stdout.log b/tests/testsuite/cargo_remove/invalid_gc_patch/stdout.log new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/tests/testsuite/cargo_remove/mod.rs b/tests/testsuite/cargo_remove/mod.rs index d4c089db7db4..57da18883e75 100644 --- a/tests/testsuite/cargo_remove/mod.rs +++ b/tests/testsuite/cargo_remove/mod.rs @@ -8,6 +8,7 @@ mod gc_replace; mod help; mod invalid_arg; mod invalid_dep; +mod invalid_gc_patch; mod invalid_package; mod invalid_package_multiple; mod invalid_section;