]> git.proxmox.com Git - cargo.git/blob - tests/testsuite/edition.rs
Add RegistryBuilder to help initializing test registries.
[cargo.git] / tests / testsuite / edition.rs
1 //! Tests for edition setting.
2
3 use cargo_test_support::{basic_lib_manifest, project};
4
5 #[cargo_test]
6 fn edition_works_for_build_script() {
7 let p = project()
8 .file(
9 "Cargo.toml",
10 r#"
11 [package]
12 name = 'foo'
13 version = '0.1.0'
14 edition = '2018'
15
16 [build-dependencies]
17 a = { path = 'a' }
18 "#,
19 )
20 .file("src/lib.rs", "")
21 .file(
22 "build.rs",
23 r#"
24 fn main() {
25 a::foo();
26 }
27 "#,
28 )
29 .file("a/Cargo.toml", &basic_lib_manifest("a"))
30 .file("a/src/lib.rs", "pub fn foo() {}")
31 .build();
32
33 p.cargo("build -v").run();
34 }