mirror of
https://github.com/rust-lang/cargo.git
synced 2025-09-28 11:20:36 +00:00
test(remove): Show what happens with last dep in a table
This commit is contained in:
parent
c4a9e45519
commit
e0477a3869
13
tests/testsuite/cargo_remove/last_dep/in/Cargo.toml
Normal file
13
tests/testsuite/cargo_remove/last_dep/in/Cargo.toml
Normal file
@ -0,0 +1,13 @@
|
||||
[package]
|
||||
name = "cargo-remove-test-fixture"
|
||||
version = "0.1.0"
|
||||
edition = "2015"
|
||||
|
||||
[[bin]]
|
||||
name = "main"
|
||||
path = "src/main.rs"
|
||||
|
||||
[dependencies]
|
||||
docopt = "0.6"
|
||||
|
||||
[features]
|
1
tests/testsuite/cargo_remove/last_dep/in/src/lib.rs
Normal file
1
tests/testsuite/cargo_remove/last_dep/in/src/lib.rs
Normal file
@ -0,0 +1 @@
|
||||
|
28
tests/testsuite/cargo_remove/last_dep/mod.rs
Normal file
28
tests/testsuite/cargo_remove/last_dep/mod.rs
Normal file
@ -0,0 +1,28 @@
|
||||
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::CargoCommandExt;
|
||||
use cargo_test_support::Project;
|
||||
|
||||
#[cargo_test]
|
||||
fn case() {
|
||||
cargo_test_support::registry::init();
|
||||
cargo_test_support::registry::Package::new("docopt", "0.6.2+my-package").publish();
|
||||
|
||||
let project = Project::from_template(current_dir!().join("in"));
|
||||
let project_root = project.root();
|
||||
let cwd = &project_root;
|
||||
|
||||
snapbox::cmd::Command::cargo_ui()
|
||||
.arg("remove")
|
||||
.args(["docopt"])
|
||||
.current_dir(cwd)
|
||||
.assert()
|
||||
.success()
|
||||
.stdout_eq(str![""])
|
||||
.stderr_eq(file!["stderr.term.svg"]);
|
||||
|
||||
assert_ui().subset_matches(current_dir!().join("out"), &project_root);
|
||||
}
|
10
tests/testsuite/cargo_remove/last_dep/out/Cargo.toml
Normal file
10
tests/testsuite/cargo_remove/last_dep/out/Cargo.toml
Normal file
@ -0,0 +1,10 @@
|
||||
[package]
|
||||
name = "cargo-remove-test-fixture"
|
||||
version = "0.1.0"
|
||||
edition = "2015"
|
||||
|
||||
[[bin]]
|
||||
name = "main"
|
||||
path = "src/main.rs"
|
||||
|
||||
[features]
|
27
tests/testsuite/cargo_remove/last_dep/stderr.term.svg
Normal file
27
tests/testsuite/cargo_remove/last_dep/stderr.term.svg
Normal file
@ -0,0 +1,27 @@
|
||||
<svg width="740px" height="56px" xmlns="http://www.w3.org/2000/svg">
|
||||
<style>
|
||||
.fg { fill: #AAAAAA }
|
||||
.bg { background: #000000 }
|
||||
.fg-green { fill: #00AA00 }
|
||||
.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-green bold"> Removing</tspan><tspan> docopt from dependencies</tspan>
|
||||
</tspan>
|
||||
<tspan x="10px" y="46px">
|
||||
</tspan>
|
||||
</text>
|
||||
|
||||
</svg>
|
After Width: | Height: | Size: 731 B |
@ -15,6 +15,7 @@ mod invalid_section;
|
||||
mod invalid_section_dep;
|
||||
mod invalid_target;
|
||||
mod invalid_target_dep;
|
||||
mod last_dep;
|
||||
mod multiple_deps;
|
||||
mod multiple_dev;
|
||||
mod no_arg;
|
||||
|
Loading…
x
Reference in New Issue
Block a user