mirror of
https://github.com/rust-lang/cargo.git
synced 2025-09-28 11:20:36 +00:00
test(add): show config-include cannot be enabled in top-level config
This commit is contained in:
parent
606adeeea6
commit
8bfc31f975
@ -48,6 +48,37 @@ fn simple() {
|
||||
assert_eq!(gctx.get::<i32>("key3").unwrap(), 4);
|
||||
}
|
||||
|
||||
#[cargo_test]
|
||||
fn enable_in_unstable_config() {
|
||||
// config-include enabled in the unstable config table:
|
||||
write_config_at(
|
||||
".cargo/config.toml",
|
||||
"
|
||||
include = 'other.toml'
|
||||
key1 = 1
|
||||
key2 = 2
|
||||
|
||||
[unstable]
|
||||
config-include = true
|
||||
",
|
||||
);
|
||||
write_config_at(
|
||||
".cargo/other.toml",
|
||||
"
|
||||
key2 = 3
|
||||
key3 = 4
|
||||
",
|
||||
);
|
||||
let gctx = GlobalContextBuilder::new()
|
||||
.nightly_features_allowed(true)
|
||||
.build();
|
||||
// On this commit, enabling `config-include` in the top-level
|
||||
// configuration does not yet work.
|
||||
assert_eq!(gctx.get::<i32>("key1").unwrap(), 1);
|
||||
assert_eq!(gctx.get::<i32>("key2").unwrap(), 2);
|
||||
assert_eq!(gctx.get::<i32>("key3").ok(), None);
|
||||
}
|
||||
|
||||
#[cargo_test]
|
||||
fn works_with_cli() {
|
||||
write_config_at(
|
||||
|
Loading…
x
Reference in New Issue
Block a user