@@ -9,7 +9,7 @@ use super::config::{GlobalContextBuilder, assert_error, write_config_at, write_c
99#[ cargo_test]
1010fn gated ( ) {
1111 // Requires -Z flag.
12- write_config_toml ( "include='other.toml'" ) ;
12+ write_config_toml ( "include=[ 'other.toml'] " ) ;
1313 write_config_at (
1414 ".cargo/other.toml" ,
1515 "
@@ -30,7 +30,7 @@ fn simple() {
3030 write_config_at (
3131 ".cargo/config.toml" ,
3232 "
33- include = 'other.toml'
33+ include = [ 'other.toml']
3434 key1 = 1
3535 key2 = 2
3636 " ,
@@ -56,7 +56,7 @@ fn enable_in_unstable_config() {
5656 write_config_at (
5757 ".cargo/config.toml" ,
5858 "
59- include = 'other.toml'
59+ include = [ 'other.toml']
6060 key1 = 1
6161 key2 = 2
6262
@@ -84,7 +84,7 @@ fn mix_of_hierarchy_and_include() {
8484 write_config_at (
8585 "foo/.cargo/config.toml" ,
8686 "
87- include = 'other.toml'
87+ include = [ 'other.toml']
8888 key1 = 1
8989
9090 # also make sure unstable flags merge in the correct order
@@ -105,7 +105,7 @@ fn mix_of_hierarchy_and_include() {
105105 write_config_at (
106106 ".cargo/config.toml" ,
107107 "
108- include = 'other.toml'
108+ include = [ 'other.toml']
109109 key1 = 3
110110 key2 = 3
111111 key3 = 3
@@ -153,7 +153,7 @@ fn mix_of_hierarchy_and_include_with_enable_in_unstable_config() {
153153 write_config_at (
154154 "foo/.cargo/config.toml" ,
155155 "
156- include = 'other.toml'
156+ include = [ 'other.toml']
157157 key1 = 1
158158
159159 # also make sure unstable flags merge in the correct order
@@ -175,7 +175,7 @@ fn mix_of_hierarchy_and_include_with_enable_in_unstable_config() {
175175 write_config_at (
176176 ".cargo/config.toml" ,
177177 "
178- include = 'other.toml'
178+ include = [ 'other.toml']
179179 key1 = 3
180180 key2 = 3
181181 key3 = 3
@@ -220,7 +220,7 @@ fn works_with_cli() {
220220 write_config_at (
221221 ".cargo/config.toml" ,
222222 "
223- include = 'other.toml'
223+ include = [ 'other.toml']
224224 [build]
225225 rustflags = ['-W', 'unused']
226226 " ,
@@ -265,7 +265,7 @@ fn left_to_right_bottom_to_top() {
265265 write_config_at (
266266 ".cargo/right-middle.toml" ,
267267 "
268- include = 'right-bottom.toml'
268+ include = [ 'right-bottom.toml']
269269 top = 0
270270 right-middle = 0
271271 " ,
@@ -281,7 +281,7 @@ fn left_to_right_bottom_to_top() {
281281 write_config_at (
282282 ".cargo/left-middle.toml" ,
283283 "
284- include = 'left-bottom.toml'
284+ include = [ 'left-bottom.toml']
285285 top = -2
286286 right-middle = -2
287287 right-bottom = -2
@@ -313,13 +313,13 @@ fn nested_include_resolves_relative_to_including_file() {
313313 write_config_at (
314314 ".cargo/config.toml" ,
315315 "
316- include = '../config/cargo.toml'
316+ include = [ '../config/cargo.toml']
317317 " ,
318318 ) ;
319319 write_config_at (
320320 "config/cargo.toml" ,
321321 "
322- include = 'other.toml'
322+ include = [ 'other.toml']
323323 middle = 10
324324 " ,
325325 ) ;
@@ -351,7 +351,7 @@ fn nested_include_resolves_relative_to_including_file() {
351351#[ cargo_test]
352352fn missing_file ( ) {
353353 // Error when there's a missing file.
354- write_config_toml ( "include='missing.toml'" ) ;
354+ write_config_toml ( "include=[ 'missing.toml'] " ) ;
355355 let gctx = GlobalContextBuilder :: new ( )
356356 . unstable_flag ( "config-include" )
357357 . build_err ( ) ;
@@ -375,7 +375,7 @@ Caused by:
375375#[ cargo_test]
376376fn wrong_file_extension ( ) {
377377 // Error when it doesn't end with `.toml`.
378- write_config_toml ( "include='config.png'" ) ;
378+ write_config_toml ( "include=[ 'config.png'] " ) ;
379379 let gctx = GlobalContextBuilder :: new ( )
380380 . unstable_flag ( "config-include" )
381381 . build_err ( ) ;
@@ -393,9 +393,9 @@ Caused by:
393393#[ cargo_test]
394394fn cycle ( ) {
395395 // Detects a cycle.
396- write_config_at ( ".cargo/config.toml" , "include='one.toml'" ) ;
397- write_config_at ( ".cargo/one.toml" , "include='two.toml'" ) ;
398- write_config_at ( ".cargo/two.toml" , "include='config.toml'" ) ;
396+ write_config_at ( ".cargo/config.toml" , "include=[ 'one.toml'] " ) ;
397+ write_config_at ( ".cargo/one.toml" , "include=[ 'two.toml'] " ) ;
398+ write_config_at ( ".cargo/two.toml" , "include=[ 'config.toml'] " ) ;
399399 let gctx = GlobalContextBuilder :: new ( )
400400 . unstable_flag ( "config-include" )
401401 . build_err ( ) ;
@@ -433,7 +433,7 @@ fn cli_include() {
433433 write_config_at ( ".cargo/config-foo.toml" , "foo = 2" ) ;
434434 let gctx = GlobalContextBuilder :: new ( )
435435 . unstable_flag ( "config-include" )
436- . config_arg ( "include='.cargo/config-foo.toml'" )
436+ . config_arg ( "include=[ '.cargo/config-foo.toml'] " )
437437 . build ( ) ;
438438 assert_eq ! ( gctx. get:: <i32 >( "foo" ) . unwrap( ) , 2 ) ;
439439 assert_eq ! ( gctx. get:: <i32 >( "bar" ) . unwrap( ) , 2 ) ;
@@ -452,7 +452,7 @@ fn bad_format() {
452452could not load Cargo configuration
453453
454454Caused by:
455- expected a string or list of strings , but found integer at `include` in `[ROOT]/.cargo/config.toml
455+ expected a list of strings or a list of tables , but found integer at `include` in `[ROOT]/.cargo/config.toml
456456"# ] ] ,
457457 ) ;
458458}
@@ -462,7 +462,7 @@ fn cli_include_failed() {
462462 // Error message when CLI include fails to load.
463463 let gctx = GlobalContextBuilder :: new ( )
464464 . unstable_flag ( "config-include" )
465- . config_arg ( "include='foobar.toml'" )
465+ . config_arg ( "include=[ 'foobar.toml'] " )
466466 . build_err ( ) ;
467467 assert_error (
468468 gctx. unwrap_err ( ) ,
@@ -493,7 +493,7 @@ fn cli_merge_failed() {
493493 ) ;
494494 let gctx = GlobalContextBuilder :: new ( )
495495 . unstable_flag ( "config-include" )
496- . config_arg ( "include='.cargo/other.toml'" )
496+ . config_arg ( "include=[ '.cargo/other.toml'] " )
497497 . build_err ( ) ;
498498 // Maybe this error message should mention it was from an include file?
499499 assert_error (
@@ -520,13 +520,13 @@ fn cli_include_take_priority_over_env() {
520520 let gctx = GlobalContextBuilder :: new ( )
521521 . env ( "CARGO_K" , "env" )
522522 . unstable_flag ( "config-include" )
523- . config_arg ( "include='.cargo/include.toml'" )
523+ . config_arg ( "include=[ '.cargo/include.toml'] " )
524524 . build ( ) ;
525525 assert_eq ! ( gctx. get:: <String >( "k" ) . unwrap( ) , "include" ) ;
526526
527527 // k=env
528528 // --config '.cargo/foo.toml'
529- write_config_at ( ".cargo/foo.toml" , "include='include.toml'" ) ;
529+ write_config_at ( ".cargo/foo.toml" , "include=[ 'include.toml'] " ) ;
530530 let gctx = GlobalContextBuilder :: new ( )
531531 . env ( "CARGO_K" , "env" )
532532 . unstable_flag ( "config-include" )
@@ -728,7 +728,7 @@ Caused by:
728728#[ cargo_test]
729729fn disallow_glob_syntax ( ) {
730730 // Reserved for future extension
731- write_config_toml ( "include = 'config-*.toml'" ) ;
731+ write_config_toml ( "include = [ 'config-*.toml'] " ) ;
732732 let gctx = GlobalContextBuilder :: new ( )
733733 . unstable_flag ( "config-include" )
734734 . build_err ( ) ;
@@ -746,7 +746,7 @@ Caused by:
746746#[ cargo_test]
747747fn disallow_template_syntax ( ) {
748748 // Reserved for future extension
749- write_config_toml ( "include = '{workspace-root}/config.toml'" ) ;
749+ write_config_toml ( "include = [ '{workspace-root}/config.toml'] " ) ;
750750 let gctx = GlobalContextBuilder :: new ( )
751751 . unstable_flag ( "config-include" )
752752 . build_err ( ) ;
0 commit comments