Skip to content

Commit 541d9a8

Browse files
calebcartwrighttopecongiro
authored andcommitted
tests: fix failing default config unit test (rust-lang#3743)
1 parent 1de58ce commit 541d9a8

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

src/config/mod.rs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -465,7 +465,8 @@ mod test {
465465

466466
#[test]
467467
fn test_dump_default_config() {
468-
const DEFAULT_CONFIG: &str = r#"max_width = 100
468+
let default_config = format!(
469+
r#"max_width = 100
469470
hard_tabs = false
470471
tab_spaces = 4
471472
newline_style = "Auto"
@@ -519,7 +520,7 @@ use_field_init_shorthand = false
519520
force_explicit_abi = true
520521
condense_wildcard_suffixes = false
521522
color = "Auto"
522-
required_version = "1.4.4"
523+
required_version = "{}"
523524
unstable_features = false
524525
disable_all_formatting = false
525526
skip_children = false
@@ -531,9 +532,11 @@ report_fixme = "Never"
531532
ignore = []
532533
emit_mode = "Files"
533534
make_backup = false
534-
"#;
535+
"#,
536+
env!("CARGO_PKG_VERSION")
537+
);
535538
let toml = Config::default().all_options().to_toml().unwrap();
536-
assert_eq!(&toml, DEFAULT_CONFIG);
539+
assert_eq!(&toml, &default_config);
537540
}
538541

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

0 commit comments

Comments
 (0)