diff options
Diffstat (limited to 'src/tools/cargo/tests/testsuite/cargo_add/lockfile_updated')
8 files changed, 84 insertions, 0 deletions
diff --git a/src/tools/cargo/tests/testsuite/cargo_add/lockfile_updated/in/Cargo.lock b/src/tools/cargo/tests/testsuite/cargo_add/lockfile_updated/in/Cargo.lock new file mode 100644 index 000000000..d9bcc988d --- /dev/null +++ b/src/tools/cargo/tests/testsuite/cargo_add/lockfile_updated/in/Cargo.lock @@ -0,0 +1,17 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "cargo-list-test-fixture" +version = "0.0.0" +dependencies = [ + "my-package", + "unrelateed-crate", +] + +[[package]] +name = "unrelateed-crate" +version = "0.2.0+my-package" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "266de4849a570b5dfda5e8e082a2aff885e9d2d4965dae8f8b6c8535e1ec731f" diff --git a/src/tools/cargo/tests/testsuite/cargo_add/lockfile_updated/in/Cargo.toml b/src/tools/cargo/tests/testsuite/cargo_add/lockfile_updated/in/Cargo.toml new file mode 100644 index 000000000..95276d7c5 --- /dev/null +++ b/src/tools/cargo/tests/testsuite/cargo_add/lockfile_updated/in/Cargo.toml @@ -0,0 +1,8 @@ +[workspace] + +[package] +name = "cargo-list-test-fixture" +version = "0.0.0" + +[dependencies] +unrelateed-crate = "0.2.0" diff --git a/src/tools/cargo/tests/testsuite/cargo_add/lockfile_updated/in/src/lib.rs b/src/tools/cargo/tests/testsuite/cargo_add/lockfile_updated/in/src/lib.rs new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/src/tools/cargo/tests/testsuite/cargo_add/lockfile_updated/in/src/lib.rs diff --git a/src/tools/cargo/tests/testsuite/cargo_add/lockfile_updated/mod.rs b/src/tools/cargo/tests/testsuite/cargo_add/lockfile_updated/mod.rs new file mode 100644 index 000000000..33889dffa --- /dev/null +++ b/src/tools/cargo/tests/testsuite/cargo_add/lockfile_updated/mod.rs @@ -0,0 +1,25 @@ +use cargo_test_support::compare::assert_ui; +use cargo_test_support::prelude::*; +use cargo_test_support::Project; + +use crate::cargo_add::init_registry; +use cargo_test_support::curr_dir; + +#[cargo_test] +fn case() { + init_registry(); + let project = Project::from_template(curr_dir!().join("in")); + let project_root = project.root(); + let cwd = &project_root; + + snapbox::cmd::Command::cargo_ui() + .arg("add") + .arg_line("my-package") + .current_dir(cwd) + .assert() + .success() + .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/src/tools/cargo/tests/testsuite/cargo_add/lockfile_updated/out/Cargo.lock b/src/tools/cargo/tests/testsuite/cargo_add/lockfile_updated/out/Cargo.lock new file mode 100644 index 000000000..4b5fb465f --- /dev/null +++ b/src/tools/cargo/tests/testsuite/cargo_add/lockfile_updated/out/Cargo.lock @@ -0,0 +1,23 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "cargo-list-test-fixture" +version = "0.0.0" +dependencies = [ + "my-package", + "unrelateed-crate", +] + +[[package]] +name = "my-package" +version = "99999.0.0+my-package" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62c45acf9e11d2f97f5b318143219c0b4102eafef1c22a4b545b47104691d915" + +[[package]] +name = "unrelateed-crate" +version = "0.2.0+my-package" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "266de4849a570b5dfda5e8e082a2aff885e9d2d4965dae8f8b6c8535e1ec731f" diff --git a/src/tools/cargo/tests/testsuite/cargo_add/lockfile_updated/out/Cargo.toml b/src/tools/cargo/tests/testsuite/cargo_add/lockfile_updated/out/Cargo.toml new file mode 100644 index 000000000..3176a986a --- /dev/null +++ b/src/tools/cargo/tests/testsuite/cargo_add/lockfile_updated/out/Cargo.toml @@ -0,0 +1,9 @@ +[workspace] + +[package] +name = "cargo-list-test-fixture" +version = "0.0.0" + +[dependencies] +my-package = "99999.0.0" +unrelateed-crate = "0.2.0" diff --git a/src/tools/cargo/tests/testsuite/cargo_add/lockfile_updated/stderr.log b/src/tools/cargo/tests/testsuite/cargo_add/lockfile_updated/stderr.log new file mode 100644 index 000000000..fd6b711e3 --- /dev/null +++ b/src/tools/cargo/tests/testsuite/cargo_add/lockfile_updated/stderr.log @@ -0,0 +1,2 @@ + Updating `dummy-registry` index + Adding my-package v99999.0.0 to dependencies. diff --git a/src/tools/cargo/tests/testsuite/cargo_add/lockfile_updated/stdout.log b/src/tools/cargo/tests/testsuite/cargo_add/lockfile_updated/stdout.log new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/src/tools/cargo/tests/testsuite/cargo_add/lockfile_updated/stdout.log |