mirror of
https://github.com/rust-lang/cargo.git
synced 2025-10-01 11:30:39 +00:00
test(pkgid): Add cases for partial versions
This commit is contained in:
parent
018b7589e8
commit
3d2f371737
@ -146,6 +146,34 @@ fn multiple_versions() {
|
|||||||
.with_stdout("https://github.com/rust-lang/crates.io-index#two-ver@0.2.0")
|
.with_stdout("https://github.com/rust-lang/crates.io-index#two-ver@0.2.0")
|
||||||
.run();
|
.run();
|
||||||
|
|
||||||
|
// Incomplete version.
|
||||||
|
p.cargo("pkgid two-ver@0")
|
||||||
|
.with_status(101)
|
||||||
|
.with_stderr(
|
||||||
|
"\
|
||||||
|
error: invalid package ID specification: `two-ver@0`
|
||||||
|
|
||||||
|
<tab>Did you mean `two-ver`?
|
||||||
|
|
||||||
|
Caused by:
|
||||||
|
cannot parse '0' as a semver
|
||||||
|
",
|
||||||
|
)
|
||||||
|
.run();
|
||||||
|
|
||||||
|
// Incomplete version.
|
||||||
|
p.cargo("pkgid two-ver@0.2")
|
||||||
|
.with_status(101)
|
||||||
|
.with_stderr(
|
||||||
|
"\
|
||||||
|
error: invalid package ID specification: `two-ver@0.2`
|
||||||
|
|
||||||
|
Caused by:
|
||||||
|
cannot parse '0.2' as a semver
|
||||||
|
",
|
||||||
|
)
|
||||||
|
.run();
|
||||||
|
|
||||||
// Ambiguous.
|
// Ambiguous.
|
||||||
p.cargo("pkgid two-ver")
|
p.cargo("pkgid two-ver")
|
||||||
.with_status(101)
|
.with_status(101)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user