summaryrefslogtreecommitdiffstats
path: root/src/tools/cargo/tests/testsuite/cargo_update
diff options
context:
space:
mode:
Diffstat (limited to 'src/tools/cargo/tests/testsuite/cargo_update')
-rw-r--r--src/tools/cargo/tests/testsuite/cargo_update/help/stdout.log12
-rw-r--r--src/tools/cargo/tests/testsuite/cargo_update/mod.rs1
-rw-r--r--src/tools/cargo/tests/testsuite/cargo_update/toolchain_pkgname/in/Cargo.toml5
-rw-r--r--src/tools/cargo/tests/testsuite/cargo_update/toolchain_pkgname/in/src/main.rs3
-rw-r--r--src/tools/cargo/tests/testsuite/cargo_update/toolchain_pkgname/mod.rs19
-rw-r--r--src/tools/cargo/tests/testsuite/cargo_update/toolchain_pkgname/stderr.log2
-rw-r--r--src/tools/cargo/tests/testsuite/cargo_update/toolchain_pkgname/stdout.log0
7 files changed, 36 insertions, 6 deletions
diff --git a/src/tools/cargo/tests/testsuite/cargo_update/help/stdout.log b/src/tools/cargo/tests/testsuite/cargo_update/help/stdout.log
index 6cc109151..92caeb656 100644
--- a/src/tools/cargo/tests/testsuite/cargo_update/help/stdout.log
+++ b/src/tools/cargo/tests/testsuite/cargo_update/help/stdout.log
@@ -1,11 +1,11 @@
Update dependencies as recorded in the local lock file
-Usage: cargo[EXE] update [OPTIONS]
+Usage: cargo[EXE] update [OPTIONS] [SPEC]...
Options:
- --dry-run Don't actually write the lockfile
- --aggressive Force updating all dependencies of SPEC as well when used with -p
- --precise <PRECISE> Update a single dependency to exactly PRECISE when used with -p
+ -n, --dry-run Don't actually write the lockfile
+ --recursive Force updating all dependencies of [SPEC]... as well
+ --precise <PRECISE> Update [SPEC] to exactly PRECISE
-q, --quiet Do not print cargo log messages
-v, --verbose... Use verbose output (-vv very verbose/build.rs output)
--color <WHEN> Coloring: auto, always, never
@@ -14,8 +14,8 @@ Options:
-h, --help Print help
Package Selection:
- -w, --workspace Only update the workspace packages
- -p, --package [<SPEC>] Package to update
+ -w, --workspace Only update the workspace packages
+ [SPEC]... Package to update
Manifest Options:
--manifest-path <PATH> Path to Cargo.toml
diff --git a/src/tools/cargo/tests/testsuite/cargo_update/mod.rs b/src/tools/cargo/tests/testsuite/cargo_update/mod.rs
index c0ce11180..a809d9fe9 100644
--- a/src/tools/cargo/tests/testsuite/cargo_update/mod.rs
+++ b/src/tools/cargo/tests/testsuite/cargo_update/mod.rs
@@ -1 +1,2 @@
mod help;
+mod toolchain_pkgname;
diff --git a/src/tools/cargo/tests/testsuite/cargo_update/toolchain_pkgname/in/Cargo.toml b/src/tools/cargo/tests/testsuite/cargo_update/toolchain_pkgname/in/Cargo.toml
new file mode 100644
index 000000000..c844631b2
--- /dev/null
+++ b/src/tools/cargo/tests/testsuite/cargo_update/toolchain_pkgname/in/Cargo.toml
@@ -0,0 +1,5 @@
+[package]
+name = "test"
+version = "0.1.0"
+
+[dependencies]
diff --git a/src/tools/cargo/tests/testsuite/cargo_update/toolchain_pkgname/in/src/main.rs b/src/tools/cargo/tests/testsuite/cargo_update/toolchain_pkgname/in/src/main.rs
new file mode 100644
index 000000000..e7a11a969
--- /dev/null
+++ b/src/tools/cargo/tests/testsuite/cargo_update/toolchain_pkgname/in/src/main.rs
@@ -0,0 +1,3 @@
+fn main() {
+ println!("Hello, world!");
+}
diff --git a/src/tools/cargo/tests/testsuite/cargo_update/toolchain_pkgname/mod.rs b/src/tools/cargo/tests/testsuite/cargo_update/toolchain_pkgname/mod.rs
new file mode 100644
index 000000000..f1488b90d
--- /dev/null
+++ b/src/tools/cargo/tests/testsuite/cargo_update/toolchain_pkgname/mod.rs
@@ -0,0 +1,19 @@
+use cargo_test_support::curr_dir;
+use cargo_test_support::prelude::*;
+use cargo_test_support::Project;
+
+#[cargo_test]
+fn case() {
+ let project = Project::from_template(curr_dir!().join("in"));
+ let project_root = project.root();
+ let cwd = &project_root;
+
+ snapbox::cmd::Command::cargo_ui()
+ .arg("update")
+ .arg("+stable")
+ .current_dir(cwd)
+ .assert()
+ .code(101)
+ .stdout_matches_path(curr_dir!().join("stdout.log"))
+ .stderr_matches_path(curr_dir!().join("stderr.log"));
+}
diff --git a/src/tools/cargo/tests/testsuite/cargo_update/toolchain_pkgname/stderr.log b/src/tools/cargo/tests/testsuite/cargo_update/toolchain_pkgname/stderr.log
new file mode 100644
index 000000000..7e5870c54
--- /dev/null
+++ b/src/tools/cargo/tests/testsuite/cargo_update/toolchain_pkgname/stderr.log
@@ -0,0 +1,2 @@
+error: invalid character `+` in package name: `+stable`
+ Use `cargo +stable update` if you meant to use the `stable` toolchain.
diff --git a/src/tools/cargo/tests/testsuite/cargo_update/toolchain_pkgname/stdout.log b/src/tools/cargo/tests/testsuite/cargo_update/toolchain_pkgname/stdout.log
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/src/tools/cargo/tests/testsuite/cargo_update/toolchain_pkgname/stdout.log