Skip to content

Commit 3d3457a

Browse files
committed
test: install v prefixed semver failing tests
1 parent 466a8e2 commit 3d3457a

File tree

1 file changed

+64
-0
lines changed

1 file changed

+64
-0
lines changed

tests/testsuite/install.rs

+64
Original file line numberDiff line numberDiff line change
@@ -1616,6 +1616,21 @@ fn vers_precise() {
16161616
.run();
16171617
}
16181618

1619+
#[cargo_test]
1620+
fn vers_precise_prefixing_v() {
1621+
pkg("foo", "0.1.1");
1622+
pkg("foo", "0.1.2");
1623+
1624+
cargo_process("install foo --vers v0.1.1")
1625+
.with_status(1)
1626+
.with_stdout_data("")
1627+
.with_stderr_data(str![[r#"
1628+
[ERROR] invalid value 'v0.1.1' for '--version <VERSION>': unexpected character 'v' while parsing major version number
1629+
...
1630+
"#]])
1631+
.run();
1632+
}
1633+
16191634
#[cargo_test]
16201635
fn version_precise() {
16211636
pkg("foo", "0.1.1");
@@ -1630,6 +1645,21 @@ fn version_precise() {
16301645
.run();
16311646
}
16321647

1648+
#[cargo_test]
1649+
fn version_precise_prefixing_v() {
1650+
pkg("foo", "0.1.1");
1651+
pkg("foo", "0.1.2");
1652+
1653+
cargo_process("install foo --version v0.1.1")
1654+
.with_status(1)
1655+
.with_stdout_data("")
1656+
.with_stderr_data(str![[r#"
1657+
[ERROR] invalid value 'v0.1.1' for '--version <VERSION>': unexpected character 'v' while parsing major version number
1658+
...
1659+
"#]])
1660+
.run();
1661+
}
1662+
16331663
#[cargo_test]
16341664
fn inline_version_precise() {
16351665
pkg("foo", "0.1.1");
@@ -1644,6 +1674,21 @@ fn inline_version_precise() {
16441674
.run();
16451675
}
16461676

1677+
#[cargo_test]
1678+
fn inline_version_precise_prefixing_v() {
1679+
pkg("foo", "0.1.1");
1680+
pkg("foo", "0.1.2");
1681+
1682+
cargo_process("install [email protected]")
1683+
.with_status(1)
1684+
.with_stdout_data("")
1685+
.with_stderr_data(str![[r#"
1686+
[ERROR] invalid value '[email protected]' for '[CRATE[@<VER>]]...': unexpected character 'v' while parsing major version number
1687+
...
1688+
"#]])
1689+
.run();
1690+
}
1691+
16471692
#[cargo_test]
16481693
fn inline_version_multiple() {
16491694
pkg("foo", "0.1.0");
@@ -1664,6 +1709,25 @@ fn inline_version_multiple() {
16641709
.run();
16651710
}
16661711

1712+
#[cargo_test]
1713+
fn inline_version_multiple_prefixing_v() {
1714+
pkg("foo", "0.1.0");
1715+
pkg("foo", "0.1.1");
1716+
pkg("foo", "0.1.2");
1717+
pkg("bar", "0.2.0");
1718+
pkg("bar", "0.2.1");
1719+
pkg("bar", "0.2.2");
1720+
1721+
cargo_process("install [email protected] [email protected]")
1722+
.with_status(1)
1723+
.with_stdout_data("")
1724+
.with_stderr_data(str![[r#"
1725+
[ERROR] invalid value '[email protected]' for '[CRATE[@<VER>]]...': unexpected character 'v' while parsing major version number
1726+
...
1727+
"#]])
1728+
.run();
1729+
}
1730+
16671731
#[cargo_test]
16681732
fn inline_version_without_name() {
16691733
pkg("foo", "0.1.1");

0 commit comments

Comments
 (0)