@@ -46,6 +46,7 @@ impl AsyncSource for AsyncFile {
46
46
}
47
47
}
48
48
49
+ #[ cfg( feature = "json" ) ]
49
50
#[ tokio:: test]
50
51
async fn test_single_async_file_source ( ) {
51
52
let config = Config :: builder ( )
@@ -60,6 +61,7 @@ async fn test_single_async_file_source() {
60
61
assert_eq ! ( true , config. get:: <bool >( "debug" ) . unwrap( ) ) ;
61
62
}
62
63
64
+ #[ cfg( all( feature = "json" , feature = "toml" ) ) ]
63
65
#[ tokio:: test]
64
66
async fn test_two_async_file_sources ( ) {
65
67
let config = Config :: builder ( )
@@ -80,6 +82,7 @@ async fn test_two_async_file_sources() {
80
82
assert_eq ! ( 1 , config. get:: <i32 >( "place.number" ) . unwrap( ) ) ;
81
83
}
82
84
85
+ #[ cfg( all( feature = "toml" , feature = "json" ) ) ]
83
86
#[ tokio:: test]
84
87
async fn test_sync_to_async_file_sources ( ) {
85
88
let config = Config :: builder ( )
@@ -96,6 +99,7 @@ async fn test_sync_to_async_file_sources() {
96
99
assert_eq ! ( 1 , config. get:: <i32 >( "place.number" ) . unwrap( ) ) ;
97
100
}
98
101
102
+ #[ cfg( all( feature = "toml" , feature = "json" ) ) ]
99
103
#[ tokio:: test]
100
104
async fn test_async_to_sync_file_sources ( ) {
101
105
let config = Config :: builder ( )
@@ -112,6 +116,7 @@ async fn test_async_to_sync_file_sources() {
112
116
assert_eq ! ( 1 , config. get:: <i32 >( "place.number" ) . unwrap( ) ) ;
113
117
}
114
118
119
+ #[ cfg( feature = "toml" ) ]
115
120
#[ tokio:: test]
116
121
async fn test_async_file_sources_with_defaults ( ) {
117
122
let config = Config :: builder ( )
@@ -132,6 +137,7 @@ async fn test_async_file_sources_with_defaults() {
132
137
assert_eq ! ( 1 , config. get:: <i32 >( "place.number" ) . unwrap( ) ) ;
133
138
}
134
139
140
+ #[ cfg( feature = "toml" ) ]
135
141
#[ tokio:: test]
136
142
async fn test_async_file_sources_with_overrides ( ) {
137
143
let config = Config :: builder ( )
0 commit comments