summaryrefslogtreecommitdiffstats
path: root/src/tools/cargo/tests/testsuite/cargo_add/overwrite_version_with_git
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-04 12:41:41 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-04 12:41:41 +0000
commit10ee2acdd26a7f1298c6f6d6b7af9b469fe29b87 (patch)
treebdffd5d80c26cf4a7a518281a204be1ace85b4c1 /src/tools/cargo/tests/testsuite/cargo_add/overwrite_version_with_git
parentReleasing progress-linux version 1.70.0+dfsg1-9~progress7.99u1. (diff)
downloadrustc-10ee2acdd26a7f1298c6f6d6b7af9b469fe29b87.tar.xz
rustc-10ee2acdd26a7f1298c6f6d6b7af9b469fe29b87.zip
Merging upstream version 1.70.0+dfsg2.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/tools/cargo/tests/testsuite/cargo_add/overwrite_version_with_git')
-rw-r--r--src/tools/cargo/tests/testsuite/cargo_add/overwrite_version_with_git/in/Cargo.toml8
-rw-r--r--src/tools/cargo/tests/testsuite/cargo_add/overwrite_version_with_git/in/src/lib.rs0
-rw-r--r--src/tools/cargo/tests/testsuite/cargo_add/overwrite_version_with_git/mod.rs34
-rw-r--r--src/tools/cargo/tests/testsuite/cargo_add/overwrite_version_with_git/out/Cargo.toml8
-rw-r--r--src/tools/cargo/tests/testsuite/cargo_add/overwrite_version_with_git/stderr.log3
-rw-r--r--src/tools/cargo/tests/testsuite/cargo_add/overwrite_version_with_git/stdout.log0
6 files changed, 53 insertions, 0 deletions
diff --git a/src/tools/cargo/tests/testsuite/cargo_add/overwrite_version_with_git/in/Cargo.toml b/src/tools/cargo/tests/testsuite/cargo_add/overwrite_version_with_git/in/Cargo.toml
new file mode 100644
index 000000000..fe41f2a90
--- /dev/null
+++ b/src/tools/cargo/tests/testsuite/cargo_add/overwrite_version_with_git/in/Cargo.toml
@@ -0,0 +1,8 @@
+[workspace]
+
+[package]
+name = "cargo-list-test-fixture"
+version = "0.0.0"
+
+[dependencies]
+versioned-package = { version = "0.1.1", optional = true }
diff --git a/src/tools/cargo/tests/testsuite/cargo_add/overwrite_version_with_git/in/src/lib.rs b/src/tools/cargo/tests/testsuite/cargo_add/overwrite_version_with_git/in/src/lib.rs
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/src/tools/cargo/tests/testsuite/cargo_add/overwrite_version_with_git/in/src/lib.rs
diff --git a/src/tools/cargo/tests/testsuite/cargo_add/overwrite_version_with_git/mod.rs b/src/tools/cargo/tests/testsuite/cargo_add/overwrite_version_with_git/mod.rs
new file mode 100644
index 000000000..ce7a0acb0
--- /dev/null
+++ b/src/tools/cargo/tests/testsuite/cargo_add/overwrite_version_with_git/mod.rs
@@ -0,0 +1,34 @@
+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;
+ let git_dep = cargo_test_support::git::new("versioned-package", |project| {
+ project
+ .file(
+ "Cargo.toml",
+ &cargo_test_support::basic_manifest("versioned-package", "0.3.0+versioned-package"),
+ )
+ .file("src/lib.rs", "")
+ });
+ let git_url = git_dep.url().to_string();
+
+ snapbox::cmd::Command::cargo_ui()
+ .arg("add")
+ .args(["versioned-package", "--git", &git_url])
+ .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/overwrite_version_with_git/out/Cargo.toml b/src/tools/cargo/tests/testsuite/cargo_add/overwrite_version_with_git/out/Cargo.toml
new file mode 100644
index 000000000..260014024
--- /dev/null
+++ b/src/tools/cargo/tests/testsuite/cargo_add/overwrite_version_with_git/out/Cargo.toml
@@ -0,0 +1,8 @@
+[workspace]
+
+[package]
+name = "cargo-list-test-fixture"
+version = "0.0.0"
+
+[dependencies]
+versioned-package = { version = "0.3.0", optional = true, git = "[ROOTURL]/versioned-package" }
diff --git a/src/tools/cargo/tests/testsuite/cargo_add/overwrite_version_with_git/stderr.log b/src/tools/cargo/tests/testsuite/cargo_add/overwrite_version_with_git/stderr.log
new file mode 100644
index 000000000..1b77cbe0e
--- /dev/null
+++ b/src/tools/cargo/tests/testsuite/cargo_add/overwrite_version_with_git/stderr.log
@@ -0,0 +1,3 @@
+ Updating git repository `[ROOTURL]/versioned-package`
+ Adding versioned-package (git) to optional dependencies.
+ Updating git repository `[ROOTURL]/versioned-package`
diff --git a/src/tools/cargo/tests/testsuite/cargo_add/overwrite_version_with_git/stdout.log b/src/tools/cargo/tests/testsuite/cargo_add/overwrite_version_with_git/stdout.log
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/src/tools/cargo/tests/testsuite/cargo_add/overwrite_version_with_git/stdout.log