@@ -302,108 +302,99 @@ fn main() {}",
302
302
303
303
#[ test]
304
304
fn insert_empty_file ( ) {
305
- {
306
- // Default configuration
307
- cov_mark :: check! ( insert_empty_file ) ;
308
- // empty files will get two trailing newlines
309
- // this is due to the test case insert_no_imports above
310
- check_crate (
311
- "foo::bar" ,
312
- "" ,
313
- r"use foo::bar;
305
+ cov_mark :: check_count! ( insert_empty_file , 2 ) ;
306
+
307
+ // Default configuration
308
+ // empty files will get two trailing newlines
309
+ // this is due to the test case insert_no_imports above
310
+ check_crate (
311
+ "foo::bar" ,
312
+ "" ,
313
+ r"use foo::bar;
314
314
315
315
" ,
316
- ) ;
317
- }
318
- {
319
- // "not group" configuration
320
- cov_mark:: check!( insert_empty_file) ;
321
- check_with_config (
322
- "use external_crate2::bar::A" ,
323
- r"" ,
324
- r"use external_crate2::bar::A;
316
+ ) ;
317
+
318
+ // "not group" configuration
319
+ check_with_config (
320
+ "use external_crate2::bar::A" ,
321
+ r"" ,
322
+ r"use external_crate2::bar::A;
325
323
326
324
" ,
327
- & InsertUseConfig {
328
- granularity : ImportGranularity :: Item ,
329
- enforce_granularity : true ,
330
- prefix_kind : PrefixKind :: Plain ,
331
- group : false ,
332
- skip_glob_imports : true ,
333
- } ,
334
- ) ;
335
- }
325
+ & InsertUseConfig {
326
+ granularity : ImportGranularity :: Item ,
327
+ enforce_granularity : true ,
328
+ prefix_kind : PrefixKind :: Plain ,
329
+ group : false ,
330
+ skip_glob_imports : true ,
331
+ } ,
332
+ ) ;
336
333
}
337
334
338
335
#[ test]
339
336
fn insert_empty_module ( ) {
340
- {
341
- // Default configuration
342
- cov_mark :: check! ( insert_empty_module ) ;
343
- check (
344
- "foo::bar" ,
345
- r"
337
+ cov_mark :: check_count! ( insert_empty_module , 2 ) ;
338
+
339
+ // Default configuration
340
+ check (
341
+ "foo::bar" ,
342
+ r"
346
343
mod x {$0}
347
344
" ,
348
- r"
345
+ r"
349
346
mod x {
350
347
use foo::bar;
351
348
}
352
349
" ,
353
- ImportGranularity :: Item ,
354
- ) ;
355
- }
356
- {
357
- // "not group" configuration
358
- cov_mark:: check!( insert_empty_module) ;
359
- check_with_config (
360
- "foo::bar" ,
361
- r"mod x {$0}" ,
362
- r"mod x {
350
+ ImportGranularity :: Item ,
351
+ ) ;
352
+
353
+ // "not group" configuration
354
+ check_with_config (
355
+ "foo::bar" ,
356
+ r"mod x {$0}" ,
357
+ r"mod x {
363
358
use foo::bar;
364
359
}" ,
365
- & InsertUseConfig {
366
- granularity : ImportGranularity :: Item ,
367
- enforce_granularity : true ,
368
- prefix_kind : PrefixKind :: Plain ,
369
- group : false ,
370
- skip_glob_imports : true ,
371
- } ,
372
- ) ;
373
- }
360
+ & InsertUseConfig {
361
+ granularity : ImportGranularity :: Item ,
362
+ enforce_granularity : true ,
363
+ prefix_kind : PrefixKind :: Plain ,
364
+ group : false ,
365
+ skip_glob_imports : true ,
366
+ } ,
367
+ ) ;
374
368
}
375
369
376
370
#[ test]
377
371
fn insert_after_inner_attr ( ) {
378
- {
379
- // Default configuration
380
- cov_mark :: check! ( insert_empty_inner_attr ) ;
381
- check_crate (
382
- "foo::bar" ,
383
- r"#![allow(unused_imports)]" ,
384
- r"#![allow(unused_imports)]
372
+ cov_mark :: check_count! ( insert_empty_inner_attr , 2 ) ;
373
+
374
+ // Default configuration
375
+ check_crate (
376
+ "foo::bar" ,
377
+ r"#![allow(unused_imports)]" ,
378
+ r"#![allow(unused_imports)]
385
379
386
380
use foo::bar;" ,
387
- ) ;
388
- }
389
- {
390
- // "not group" configuration
391
- cov_mark:: check!( insert_empty_inner_attr) ;
392
- check_with_config (
393
- "foo::bar" ,
394
- r"#![allow(unused_imports)]" ,
395
- r"#![allow(unused_imports)]
381
+ ) ;
382
+
383
+ // "not group" configuration
384
+ check_with_config (
385
+ "foo::bar" ,
386
+ r"#![allow(unused_imports)]" ,
387
+ r"#![allow(unused_imports)]
396
388
397
389
use foo::bar;" ,
398
- & InsertUseConfig {
399
- granularity : ImportGranularity :: Item ,
400
- enforce_granularity : true ,
401
- prefix_kind : PrefixKind :: Plain ,
402
- group : false ,
403
- skip_glob_imports : true ,
404
- } ,
405
- ) ;
406
- }
390
+ & InsertUseConfig {
391
+ granularity : ImportGranularity :: Item ,
392
+ enforce_granularity : true ,
393
+ prefix_kind : PrefixKind :: Plain ,
394
+ group : false ,
395
+ skip_glob_imports : true ,
396
+ } ,
397
+ ) ;
407
398
}
408
399
409
400
#[ test]
0 commit comments