Remove invalid tests

This commit is contained in:
Ali Bektas 2024-08-22 21:50:40 +02:00
parent 23eb20794e
commit 987a9342ad

View file

@ -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);
}
}