Skip to content

Commit 1be6f63

Browse files
committed
make profile_user_dist test backward compatible
1 parent c245b43 commit 1be6f63

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

src/bootstrap/src/core/config/tests.rs

+9-7
Original file line numberDiff line numberDiff line change
@@ -229,13 +229,15 @@ fn override_toml_duplicate() {
229229
#[test]
230230
fn profile_user_dist() {
231231
fn get_toml(file: &Path) -> Result<TomlConfig, toml::de::Error> {
232-
let contents =
233-
if file.ends_with("bootstrap.toml") || env::var_os("RUST_BOOTSTRAP_CONFIG").is_some() {
234-
"profile = \"user\"".to_owned()
235-
} else {
236-
assert!(file.ends_with("config.dist.toml"));
237-
std::fs::read_to_string(file).unwrap()
238-
};
232+
let contents = if file.ends_with("bootstrap.toml")
233+
|| file.ends_with("config.toml")
234+
|| env::var_os("RUST_BOOTSTRAP_CONFIG").is_some()
235+
{
236+
"profile = \"user\"".to_owned()
237+
} else {
238+
assert!(file.ends_with("config.dist.toml") || file.ends_with("bootstrap.dist.toml"));
239+
std::fs::read_to_string(file).unwrap()
240+
};
239241

240242
toml::from_str(&contents).and_then(|table: toml::Value| TomlConfig::deserialize(table))
241243
}

0 commit comments

Comments
 (0)