mirror of
https://github.com/rust-lang/cargo
synced 2024-10-02 14:04:23 +00:00
Remove tests related to stripping names.
This commit is contained in:
parent
3e7c75a7a6
commit
e101b92d7a
33
tests/new.rs
33
tests/new.rs
|
@ -163,37 +163,6 @@ fn keyword_name() {
|
|||
use --name to override crate name"));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn rust_prefix_stripped() {
|
||||
assert_that(cargo_process("new").arg("--lib").arg("rust-foo").env("USER", "foo"),
|
||||
execs().with_status(0)
|
||||
.with_stderr_contains("note: package will be named `foo`; use --name to override"));
|
||||
let toml = paths::root().join("rust-foo/Cargo.toml");
|
||||
let mut contents = String::new();
|
||||
File::open(&toml).unwrap().read_to_string(&mut contents).unwrap();
|
||||
assert!(contents.contains(r#"name = "foo""#));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn bin_disables_stripping() {
|
||||
assert_that(cargo_process("new").arg("rust-foo").arg("--bin").env("USER", "foo"),
|
||||
execs().with_status(0));
|
||||
let toml = paths::root().join("rust-foo/Cargo.toml");
|
||||
let mut contents = String::new();
|
||||
File::open(&toml).unwrap().read_to_string(&mut contents).unwrap();
|
||||
assert!(contents.contains(r#"name = "rust-foo""#));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn explicit_name_not_stripped() {
|
||||
assert_that(cargo_process("new").arg("foo").arg("--name").arg("rust-bar").env("USER", "foo"),
|
||||
execs().with_status(0));
|
||||
let toml = paths::root().join("foo/Cargo.toml");
|
||||
let mut contents = String::new();
|
||||
File::open(&toml).unwrap().read_to_string(&mut contents).unwrap();
|
||||
assert!(contents.contains(r#"name = "rust-bar""#));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn finds_author_user() {
|
||||
create_empty_gitconfig();
|
||||
|
@ -423,4 +392,4 @@ fn explicit_invalid_name_not_suggested() {
|
|||
execs().with_status(101)
|
||||
.with_stderr("\
|
||||
[ERROR] Package names starting with a digit cannot be used as a crate name"));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue