Skip to content

Commit 8bfc31f

Browse files
committed
test(add): show config-include cannot be enabled in top-level config
1 parent 606adee commit 8bfc31f

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

tests/testsuite/config_include.rs

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,37 @@ fn simple() {
4848
assert_eq!(gctx.get::<i32>("key3").unwrap(), 4);
4949
}
5050

51+
#[cargo_test]
52+
fn enable_in_unstable_config() {
53+
// config-include enabled in the unstable config table:
54+
write_config_at(
55+
".cargo/config.toml",
56+
"
57+
include = 'other.toml'
58+
key1 = 1
59+
key2 = 2
60+
61+
[unstable]
62+
config-include = true
63+
",
64+
);
65+
write_config_at(
66+
".cargo/other.toml",
67+
"
68+
key2 = 3
69+
key3 = 4
70+
",
71+
);
72+
let gctx = GlobalContextBuilder::new()
73+
.nightly_features_allowed(true)
74+
.build();
75+
// On this commit, enabling `config-include` in the top-level
76+
// configuration does not yet work.
77+
assert_eq!(gctx.get::<i32>("key1").unwrap(), 1);
78+
assert_eq!(gctx.get::<i32>("key2").unwrap(), 2);
79+
assert_eq!(gctx.get::<i32>("key3").ok(), None);
80+
}
81+
5182
#[cargo_test]
5283
fn works_with_cli() {
5384
write_config_at(

0 commit comments

Comments
 (0)