mirror of
https://github.com/rust-lang/cargo.git
synced 2025-09-25 11:14:46 +00:00
42 lines
966 B
Rust
42 lines
966 B
Rust
use support::{basic_lib_manifest, is_nightly, execs, project};
|
|
use support::hamcrest::assert_that;
|
|
|
|
#[test]
|
|
fn edition_works_for_build_script() {
|
|
if !is_nightly() {
|
|
return
|
|
}
|
|
|
|
let p = project()
|
|
.file(
|
|
"Cargo.toml",
|
|
r#"
|
|
cargo-features = ['edition']
|
|
[package]
|
|
name = 'foo'
|
|
version = '0.1.0'
|
|
edition = '2018'
|
|
|
|
[build-dependencies]
|
|
a = { path = 'a' }
|
|
"#,
|
|
)
|
|
.file("src/lib.rs", "")
|
|
.file(
|
|
"build.rs",
|
|
r#"
|
|
fn main() {
|
|
a::foo();
|
|
}
|
|
"#,
|
|
)
|
|
.file("a/Cargo.toml", &basic_lib_manifest("a"))
|
|
.file("a/src/lib.rs", "pub fn foo() {}")
|
|
.build();
|
|
|
|
assert_that(
|
|
p.cargo("build -v").masquerade_as_nightly_cargo(),
|
|
execs().with_status(0),
|
|
);
|
|
}
|