Skip to content

Commit 0186d6b

Browse files
committed
test: yank v prefixed semver failing tests
1 parent 15f315d commit 0186d6b

File tree

1 file changed

+70
-0
lines changed

1 file changed

+70
-0
lines changed

tests/testsuite/yank.rs

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,41 @@ Caused by:
5252
.run();
5353
}
5454

55+
#[cargo_test]
56+
fn explicit_version_prefixing_v() {
57+
let registry = registry::init();
58+
setup("foo", "0.0.1");
59+
60+
let p = project()
61+
.file(
62+
"Cargo.toml",
63+
r#"
64+
[package]
65+
name = "foo"
66+
version = "0.0.1"
67+
authors = []
68+
license = "MIT"
69+
description = "foo"
70+
"#,
71+
)
72+
.file("src/main.rs", "fn main() {}")
73+
.build();
74+
75+
p.cargo("yank --version v0.0.1")
76+
.replace_crates_io(registry.index_url())
77+
.with_status(101)
78+
.with_stderr_data(str![[r#"
79+
[UPDATING] crates.io index
80+
81+
[ERROR] failed to yank from the registry at [ROOTURL]/api
82+
83+
Caused by:
84+
[37] Could not read a file:// file (Couldn't open file [ROOT]/api/api/v1/crates/foo/v0.0.1/yank)
85+
86+
"#]])
87+
.run();
88+
}
89+
5590
#[cargo_test]
5691
fn explicit_version_with_asymmetric() {
5792
let registry = registry::RegistryBuilder::new()
@@ -129,6 +164,41 @@ Caused by:
129164
.run();
130165
}
131166

167+
#[cargo_test]
168+
fn inline_version_prefixing_v() {
169+
let registry = registry::init();
170+
setup("foo", "0.0.1");
171+
172+
let p = project()
173+
.file(
174+
"Cargo.toml",
175+
r#"
176+
[package]
177+
name = "foo"
178+
version = "0.0.1"
179+
authors = []
180+
license = "MIT"
181+
description = "foo"
182+
"#,
183+
)
184+
.file("src/main.rs", "fn main() {}")
185+
.build();
186+
187+
p.cargo("yank [email protected]")
188+
.replace_crates_io(registry.index_url())
189+
.with_status(101)
190+
.with_stderr_data(str![[r#"
191+
[UPDATING] crates.io index
192+
193+
[ERROR] failed to yank from the registry at [ROOTURL]/api
194+
195+
Caused by:
196+
[37] Could not read a file:// file (Couldn't open file [ROOT]/api/api/v1/crates/foo/v0.0.1/yank)
197+
198+
"#]])
199+
.run();
200+
}
201+
132202
#[cargo_test]
133203
fn version_required() {
134204
setup("foo", "0.0.1");

0 commit comments

Comments
 (0)