Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 2 additions & 10 deletions tests/testsuite/alt_registry.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use support::ChannelChanger;
use support::registry::{self, alt_api_path, Package};
use support::{execs, paths, project};
use support::{basic_manifest, execs, paths, project};
use support::hamcrest::assert_that;
use std::fs::File;
use std::io::Write;
Expand Down Expand Up @@ -249,15 +249,7 @@ fn registry_and_path_dep_works() {
"#,
)
.file("src/main.rs", "fn main() {}")
.file(
"bar/Cargo.toml",
r#"
[project]
name = "bar"
version = "0.0.1"
authors = []
"#,
)
.file("bar/Cargo.toml", &basic_manifest("bar", "0.0.1"))
.file("bar/src/lib.rs", "")
.build();

Expand Down
107 changes: 14 additions & 93 deletions tests/testsuite/bad_config.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use support::{execs, project};
use support::{basic_manifest, execs, project};
use support::registry::Package;
use support::hamcrest::assert_that;

Expand Down Expand Up @@ -598,36 +598,10 @@ Caused by:
#[test]
fn duplicate_deps() {
let p = project()
.file(
"shim-bar/Cargo.toml",
r#"
[package]
name = "bar"
version = "0.0.1"
authors = []
"#,
)
.file(
"shim-bar/src/lib.rs",
r#"
pub fn a() {}
"#,
)
.file(
"linux-bar/Cargo.toml",
r#"
[package]
name = "bar"
version = "0.0.1"
authors = []
"#,
)
.file(
"linux-bar/src/lib.rs",
r#"
pub fn a() {}
"#,
)
.file("shim-bar/Cargo.toml", &basic_manifest("bar", "0.0.1"))
.file("shim-bar/src/lib.rs", "pub fn a() {}")
.file("linux-bar/Cargo.toml", &basic_manifest("bar", "0.0.1"))
.file("linux-bar/src/lib.rs", "pub fn a() {}")
.file(
"Cargo.toml",
r#"
Expand Down Expand Up @@ -663,36 +637,10 @@ have a single canonical source path irrespective of build target.
#[test]
fn duplicate_deps_diff_sources() {
let p = project()
.file(
"shim-bar/Cargo.toml",
r#"
[package]
name = "bar"
version = "0.0.1"
authors = []
"#,
)
.file(
"shim-bar/src/lib.rs",
r#"
pub fn a() {}
"#,
)
.file(
"linux-bar/Cargo.toml",
r#"
[package]
name = "bar"
version = "0.0.1"
authors = []
"#,
)
.file(
"linux-bar/src/lib.rs",
r#"
pub fn a() {}
"#,
)
.file("shim-bar/Cargo.toml", &basic_manifest("bar", "0.0.1"))
.file("shim-bar/src/lib.rs", "pub fn a() {}")
.file("linux-bar/Cargo.toml", &basic_manifest("bar", "0.0.1"))
.file("linux-bar/src/lib.rs", "pub fn a() {}")
.file(
"Cargo.toml",
r#"
Expand Down Expand Up @@ -766,12 +714,7 @@ warning: unused manifest key: target.foo.bar
bulid = "foo"
"#,
)
.file(
"src/lib.rs",
r#"
pub fn foo() {}
"#,
)
.file("src/lib.rs", "pub fn foo() {}")
.build();
assert_that(
p.cargo("build"),
Expand All @@ -798,12 +741,7 @@ warning: unused manifest key: project.bulid
build = "foo"
"#,
)
.file(
"src/lib.rs",
r#"
pub fn foo() {}
"#,
)
.file("src/lib.rs", "pub fn foo() {}")
.build();
assert_that(
p.cargo("build"),
Expand All @@ -828,14 +766,7 @@ fn unused_keys_in_virtual_manifest() {
bulid = "foo"
"#,
)
.file(
"bar/Cargo.toml",
r#"
[project]
version = "0.0.1"
name = "bar"
"#,
)
.file("bar/Cargo.toml", &basic_manifest("bar", "0.0.1"))
.file("bar/src/lib.rs", r"")
.build();
assert_that(
Expand Down Expand Up @@ -884,12 +815,7 @@ to use. This will be considered an error in future versions
#[test]
fn invalid_toml_historically_allowed_is_warned() {
let p = project()
.file(
".cargo/config",
r#"
[bar] baz = 2
"#,
)
.file(".cargo/config", "[bar] baz = 2")
.file("src/main.rs", "fn main() {}")
.build();

Expand Down Expand Up @@ -947,12 +873,7 @@ This will be considered an error in future versions
fn bad_source_config1() {
let p = project()
.file("src/lib.rs", "")
.file(
".cargo/config",
r#"
[source.foo]
"#,
)
.file(".cargo/config", "[source.foo]")
.build();

assert_that(
Expand Down
Loading