Skip to content

Commit

Permalink
tests: fix failing default config unit test (rust-lang#3743)
Browse files Browse the repository at this point in the history
  • Loading branch information
calebcartwright authored and topecongiro committed Aug 13, 2019
1 parent 1de58ce commit 541d9a8
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/config/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,8 @@ mod test {

#[test]
fn test_dump_default_config() {
const DEFAULT_CONFIG: &str = r#"max_width = 100
let default_config = format!(
r#"max_width = 100
hard_tabs = false
tab_spaces = 4
newline_style = "Auto"
Expand Down Expand Up @@ -519,7 +520,7 @@ use_field_init_shorthand = false
force_explicit_abi = true
condense_wildcard_suffixes = false
color = "Auto"
required_version = "1.4.4"
required_version = "{}"
unstable_features = false
disable_all_formatting = false
skip_children = false
Expand All @@ -531,9 +532,11 @@ report_fixme = "Never"
ignore = []
emit_mode = "Files"
make_backup = false
"#;
"#,
env!("CARGO_PKG_VERSION")
);
let toml = Config::default().all_options().to_toml().unwrap();
assert_eq!(&toml, DEFAULT_CONFIG);
assert_eq!(&toml, &default_config);
}

// FIXME(#2183): these tests cannot be run in parallel because they use env vars.
Expand Down

0 comments on commit 541d9a8

Please sign in to comment.