Skip to content

Commit ef3e28d

Browse files
committed
test(update): Added test for prefixed v in version
1 parent d07439b commit ef3e28d

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

tests/testsuite/update.rs

+36
Original file line numberDiff line numberDiff line change
@@ -2709,3 +2709,39 @@ fn update_breaking_pre_release_upgrade() {
27092709
"#]])
27102710
.run();
27112711
}
2712+
2713+
#[cargo_test]
2714+
fn prefixed_v_in_version() {
2715+
Package::new("bar", "1.0.0").publish();
2716+
2717+
let p = project()
2718+
.file(
2719+
"Cargo.toml",
2720+
r#"
2721+
[package]
2722+
name = "foo"
2723+
version = "0.0.1"
2724+
edition = "2015"
2725+
authors = []
2726+
2727+
[dependencies]
2728+
bar = "1.0.0"
2729+
"#,
2730+
)
2731+
.file("src/lib.rs", "")
2732+
.build();
2733+
2734+
p.cargo("generate-lockfile").run();
2735+
2736+
Package::new("bar", "1.0.1").publish();
2737+
p.cargo("update bar --precise v1.0.1")
2738+
.with_status(101)
2739+
.with_stderr_data(str![[r#"
2740+
[ERROR] invalid version format for precise version `v1.0.1`
2741+
2742+
Caused by:
2743+
unexpected character 'v' while parsing major version number
2744+
2745+
"#]])
2746+
.run();
2747+
}

0 commit comments

Comments
 (0)