@@ -462,6 +462,79 @@ mod test {
462
462
assert_eq ! ( s. contains( "(unstable)" ) , true ) ;
463
463
}
464
464
465
+ #[ test]
466
+ fn test_dump_default_config ( ) {
467
+ const DEFAULT_CONFIG : & str = r#"max_width = 100
468
+ hard_tabs = false
469
+ tab_spaces = 4
470
+ newline_style = "Auto"
471
+ use_small_heuristics = "Default"
472
+ indent_style = "Block"
473
+ wrap_comments = false
474
+ format_code_in_doc_comments = false
475
+ comment_width = 80
476
+ normalize_comments = false
477
+ normalize_doc_attributes = false
478
+ license_template_path = ""
479
+ format_strings = false
480
+ format_macro_matchers = false
481
+ format_macro_bodies = true
482
+ empty_item_single_line = true
483
+ struct_lit_single_line = true
484
+ fn_single_line = false
485
+ where_single_line = false
486
+ imports_indent = "Block"
487
+ imports_layout = "Mixed"
488
+ merge_imports = false
489
+ reorder_imports = true
490
+ reorder_modules = true
491
+ reorder_impl_items = false
492
+ type_punctuation_density = "Wide"
493
+ space_before_colon = false
494
+ space_after_colon = true
495
+ spaces_around_ranges = false
496
+ binop_separator = "Front"
497
+ remove_nested_parens = true
498
+ combine_control_expr = true
499
+ overflow_delimited_expr = false
500
+ struct_field_align_threshold = 0
501
+ enum_discrim_align_threshold = 0
502
+ match_arm_blocks = true
503
+ force_multiline_blocks = false
504
+ fn_args_density = "Tall"
505
+ brace_style = "SameLineWhere"
506
+ control_brace_style = "AlwaysSameLine"
507
+ trailing_semicolon = true
508
+ trailing_comma = "Vertical"
509
+ match_block_trailing_comma = false
510
+ blank_lines_upper_bound = 1
511
+ blank_lines_lower_bound = 0
512
+ edition = "2015"
513
+ version = "One"
514
+ inline_attribute_width = 0
515
+ merge_derives = true
516
+ use_try_shorthand = false
517
+ use_field_init_shorthand = false
518
+ force_explicit_abi = true
519
+ condense_wildcard_suffixes = false
520
+ color = "Auto"
521
+ required_version = "1.2.2"
522
+ unstable_features = false
523
+ disable_all_formatting = false
524
+ skip_children = false
525
+ hide_parse_errors = false
526
+ error_on_line_overflow = false
527
+ error_on_unformatted = false
528
+ report_todo = "Never"
529
+ report_fixme = "Never"
530
+ ignore = []
531
+ emit_mode = "Files"
532
+ make_backup = false
533
+ "# ;
534
+ let toml = Config :: default ( ) . all_options ( ) . to_toml ( ) . unwrap ( ) ;
535
+ assert_eq ! ( & toml, DEFAULT_CONFIG ) ;
536
+ }
537
+
465
538
// FIXME(#2183): these tests cannot be run in parallel because they use env vars.
466
539
// #[test]
467
540
// fn test_as_not_nightly_channel() {
0 commit comments