mirror of
https://github.com/rust-lang/cargo.git
synced 2025-10-01 11:30:39 +00:00
test(base): Verify bases in patches in virtual manifests
This commit is contained in:
parent
e83dc0405b
commit
2d23b94a7f
@ -3038,7 +3038,7 @@ foo v0.0.0 ([ROOT]/foo)
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[cargo_test]
|
#[cargo_test]
|
||||||
fn patch_with_base() {
|
fn patch_in_real_with_base() {
|
||||||
let bar = project()
|
let bar = project()
|
||||||
.at("bar")
|
.at("bar")
|
||||||
.file("Cargo.toml", &basic_manifest("bar", "0.5.0"))
|
.file("Cargo.toml", &basic_manifest("bar", "0.5.0"))
|
||||||
@ -3087,3 +3087,70 @@ foo v0.5.0 ([ROOT]/foo)
|
|||||||
"#]])
|
"#]])
|
||||||
.run();
|
.run();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cargo_test]
|
||||||
|
fn patch_in_virtual_with_base() {
|
||||||
|
let bar = project()
|
||||||
|
.at("bar")
|
||||||
|
.file("Cargo.toml", &basic_manifest("bar", "0.5.0"))
|
||||||
|
.file("src/lib.rs", "pub fn hello() {}")
|
||||||
|
.build();
|
||||||
|
Package::new("bar", "0.5.0").publish();
|
||||||
|
|
||||||
|
let p = project()
|
||||||
|
.file(
|
||||||
|
".cargo/config.toml",
|
||||||
|
&format!(
|
||||||
|
r#"
|
||||||
|
[path-bases]
|
||||||
|
test = '{}'
|
||||||
|
"#,
|
||||||
|
bar.root().parent().unwrap().display()
|
||||||
|
),
|
||||||
|
)
|
||||||
|
.file(
|
||||||
|
"Cargo.toml",
|
||||||
|
r#"
|
||||||
|
cargo-features = ["path-bases"]
|
||||||
|
|
||||||
|
[workspace]
|
||||||
|
members = ["foo"]
|
||||||
|
|
||||||
|
[patch.crates-io]
|
||||||
|
bar = { base = 'test', path = 'bar' }
|
||||||
|
"#,
|
||||||
|
)
|
||||||
|
.file(
|
||||||
|
"foo/Cargo.toml",
|
||||||
|
r#"
|
||||||
|
[package]
|
||||||
|
name = "foo"
|
||||||
|
version = "0.5.0"
|
||||||
|
authors = ["wycats@example.com"]
|
||||||
|
edition = "2018"
|
||||||
|
|
||||||
|
[dependencies]
|
||||||
|
bar = "0.5.0"
|
||||||
|
"#,
|
||||||
|
)
|
||||||
|
.file("foo/src/lib.rs", "use bar::hello as _;")
|
||||||
|
.build();
|
||||||
|
|
||||||
|
p.cargo("tree")
|
||||||
|
.masquerade_as_nightly_cargo(&["path-bases"])
|
||||||
|
.with_status(101)
|
||||||
|
.with_stderr_data(str![[r#"
|
||||||
|
[ERROR] failed to load source for dependency `bar`
|
||||||
|
|
||||||
|
Caused by:
|
||||||
|
Unable to update [ROOT]/foo/bar
|
||||||
|
|
||||||
|
Caused by:
|
||||||
|
failed to read `[ROOT]/foo/bar/Cargo.toml`
|
||||||
|
|
||||||
|
Caused by:
|
||||||
|
[NOT_FOUND]
|
||||||
|
|
||||||
|
"#]])
|
||||||
|
.run();
|
||||||
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user