@@ -202,25 +202,42 @@ fn rustfmt_emits_error_when_control_brace_style_is_always_next_line() {
202
202
}
203
203
204
204
#[ test]
205
- fn ignore_missing_sub_mod_false ( ) {
205
+ fn report_missing_sub_mod_error ( ) {
206
206
// Ensure that missing submodules cause module not found errors when trying to
207
- // resolve submodules with `skip_children=false` and `ignore_missing_submod=false `
207
+ // resolve submodules with `skip_children=false` and `report_missing_submod=Error `
208
208
let args = [
209
- "--config=skip_children=false,ignore_missing_submod=false " ,
209
+ "--config=skip_children=false,report_missing_submod=Error " ,
210
210
"tests/source/issue-5609.rs" ,
211
211
] ;
212
212
let ( _stdout, stderr) = rustfmt ( & args) ;
213
213
// Module resolution fails because we're unable to find `missing_submod.rs`
214
214
assert ! ( stderr. contains( "missing_submod.rs does not exist" ) )
215
215
}
216
216
217
+ #[ test]
218
+ fn report_missing_sub_mod_warn ( ) {
219
+ // Ensure that missing submodules cause module not found warnings when trying to
220
+ // resolve submodules with `skip_children=false` and `report_missing_submod=Warn`
221
+ let args = [
222
+ "--emit=stdout" ,
223
+ "--config=skip_children=false,report_missing_submod=Warn" ,
224
+ "tests/source/issue-5609.rs" ,
225
+ ] ;
226
+ let ( stdout, stderr) = rustfmt ( & args) ;
227
+ // Module resolution succeed but we emit warnings because we're unable to find `missing_submod.rs`
228
+ assert ! ( stderr. contains( "missing_submod.rs does not exist" ) ) ;
229
+
230
+ let target = read_to_string ( PathBuf :: from ( "tests/target/issue-5609.rs" ) ) . unwrap ( ) ;
231
+ assert ! ( stdout. ends_with( & target) ) ;
232
+ }
233
+
217
234
#[ test]
218
235
fn ignore_missing_sub_mod_true ( ) {
219
236
// Ensure that missing submodules don't cause module not found errors when trying to
220
- // resolve submodules with `skip_children=false` and `ignore_missing_submod=true `.
237
+ // resolve submodules with `skip_children=false` and `report_missing_submod=Ignore `.
221
238
let args = [
222
239
"--emit=stdout" ,
223
- "--config=skip_children=false,ignore_missing_submod=true " ,
240
+ "--config=skip_children=false,report_missing_submod=Ignore " ,
224
241
"tests/source/issue-5609.rs" ,
225
242
] ;
226
243
let ( stdout, _stderr) = rustfmt ( & args) ;
0 commit comments