Skip to content

Commit

Permalink
Remove invalid tests
Browse files Browse the repository at this point in the history
  • Loading branch information
alibektas committed Aug 28, 2024
1 parent 042a932 commit 0e52706
Showing 1 changed file with 0 additions and 72 deletions.
72 changes: 0 additions & 72 deletions src/tools/rust-analyzer/crates/rust-analyzer/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3585,76 +3585,4 @@ mod tests {
matches!(config.flycheck(None), FlycheckConfig::CargoCommand { options, .. } if options.target_dir == Some(Utf8PathBuf::from("other_folder")))
);
}

#[test]
fn toml_unknown_key() {
let config =
Config::new(AbsPathBuf::assert(project_root()), Default::default(), vec![], None);

let mut change = ConfigChange::default();

change.change_user_config(Some(
toml::toml! {
[cargo.cfgs]
these = "these"
should = "should"
be = "be"
valid = "valid"

[invalid.config]
err = "error"

[cargo]
target = "ok"

// FIXME: This should be an error
[cargo.sysroot]
non-table = "expected"
}
.to_string()
.into(),
));

let (config, e, _) = config.apply_change(change);
expect_test::expect![[r#"
ConfigErrors(
[
Toml {
config_key: "invalid/config/err",
error: Error {
inner: Error {
inner: TomlError {
message: "unexpected field",
raw: None,
keys: [],
span: None,
},
},
},
},
],
)
"#]]
.assert_debug_eq(&e);
let mut change = ConfigChange::default();

change.change_user_config(Some(
toml::toml! {
[cargo.cfgs]
these = "these"
should = "should"
be = "be"
valid = "valid"
}
.to_string()
.into(),
));
let (_, e, _) = config.apply_change(change);
expect_test::expect![[r#"
ConfigErrors(
[],
)
"#]]
.assert_debug_eq(&e);
}
}

0 comments on commit 0e52706

Please sign in to comment.