mirror of
https://github.com/rust-lang/cargo.git
synced 2025-09-28 11:20:36 +00:00
test(add): Added test case for prefixed v
in version
This commit is contained in:
parent
7e09951039
commit
ac86dea366
@ -126,6 +126,7 @@ mod path_base_unstable;
|
||||
mod path_dev;
|
||||
mod path_inferred_name;
|
||||
mod path_inferred_name_conflicts_full_feature;
|
||||
mod prefixed_v_in_version;
|
||||
mod preserve_dep_std_table;
|
||||
mod preserve_features_sorted;
|
||||
mod preserve_features_table;
|
||||
|
1
tests/testsuite/cargo_add/prefixed_v_in_version/in
Symbolic link
1
tests/testsuite/cargo_add/prefixed_v_in_version/in
Symbolic link
@ -0,0 +1 @@
|
||||
../add-basic.in
|
26
tests/testsuite/cargo_add/prefixed_v_in_version/mod.rs
Normal file
26
tests/testsuite/cargo_add/prefixed_v_in_version/mod.rs
Normal file
@ -0,0 +1,26 @@
|
||||
use cargo_test_support::compare::assert_ui;
|
||||
use cargo_test_support::current_dir;
|
||||
use cargo_test_support::file;
|
||||
use cargo_test_support::prelude::*;
|
||||
use cargo_test_support::str;
|
||||
use cargo_test_support::Project;
|
||||
|
||||
#[cargo_test]
|
||||
fn case() {
|
||||
cargo_test_support::registry::init();
|
||||
|
||||
let project = Project::from_template(current_dir!().join("in"));
|
||||
let project_root = project.root();
|
||||
let cwd = &project_root;
|
||||
|
||||
snapbox::cmd::Command::cargo_ui()
|
||||
.arg("add")
|
||||
.arg_line("foo@v0.0.1")
|
||||
.current_dir(cwd)
|
||||
.assert()
|
||||
.code(101)
|
||||
.stdout_eq(str![""])
|
||||
.stderr_eq(file!["stderr.term.svg"]);
|
||||
|
||||
assert_ui().subset_matches(current_dir!().join("out"), &project_root);
|
||||
}
|
@ -0,0 +1,6 @@
|
||||
[workspace]
|
||||
|
||||
[package]
|
||||
name = "cargo-list-test-fixture"
|
||||
version = "0.0.0"
|
||||
edition = "2015"
|
@ -0,0 +1,33 @@
|
||||
<svg width="740px" height="110px" xmlns="http://www.w3.org/2000/svg">
|
||||
<style>
|
||||
.fg { fill: #AAAAAA }
|
||||
.bg { background: #000000 }
|
||||
.fg-red { fill: #AA0000 }
|
||||
.container {
|
||||
padding: 0 10px;
|
||||
line-height: 18px;
|
||||
}
|
||||
.bold { font-weight: bold; }
|
||||
tspan {
|
||||
font: 14px SFMono-Regular, Consolas, Liberation Mono, Menlo, monospace;
|
||||
white-space: pre;
|
||||
line-height: 18px;
|
||||
}
|
||||
</style>
|
||||
|
||||
<rect width="100%" height="100%" y="0" rx="4.5" class="bg" />
|
||||
|
||||
<text xml:space="preserve" class="container fg">
|
||||
<tspan x="10px" y="28px"><tspan class="fg-red bold">error</tspan><tspan class="bold">:</tspan><tspan> invalid version requirement `v0.0.1`</tspan>
|
||||
</tspan>
|
||||
<tspan x="10px" y="46px">
|
||||
</tspan>
|
||||
<tspan x="10px" y="64px"><tspan>Caused by:</tspan>
|
||||
</tspan>
|
||||
<tspan x="10px" y="82px"><tspan> unexpected character 'v' while parsing major version number</tspan>
|
||||
</tspan>
|
||||
<tspan x="10px" y="100px">
|
||||
</tspan>
|
||||
</text>
|
||||
|
||||
</svg>
|
After Width: | Height: | Size: 981 B |
Loading…
x
Reference in New Issue
Block a user