about summary refs log tree commit diff
diff options
context:
space:
mode:
authorbit-aloo <sshourya17@gmail.com>2025-03-09 17:03:40 +0530
committerbit-aloo <sshourya17@gmail.com>2025-03-17 12:56:49 +0530
commit7240c1687f2fd52acefcfd19ef9ea3037266b6a0 (patch)
tree8353b6829ebb3e789f560feb609e780071570f38
parent99aa4ed85f15af7c71ea6c2e46eae36f8bc78894 (diff)
downloadrust-7240c1687f2fd52acefcfd19ef9ea3037266b6a0.tar.gz
rust-7240c1687f2fd52acefcfd19ef9ea3037266b6a0.zip
make profile_user_dist test backward compatible
-rw-r--r--src/bootstrap/src/core/config/tests.rs16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/bootstrap/src/core/config/tests.rs b/src/bootstrap/src/core/config/tests.rs
index c5c77d19f07..7ffd2acb645 100644
--- a/src/bootstrap/src/core/config/tests.rs
+++ b/src/bootstrap/src/core/config/tests.rs
@@ -229,13 +229,15 @@ fn override_toml_duplicate() {
 #[test]
 fn profile_user_dist() {
     fn get_toml(file: &Path) -> Result<TomlConfig, toml::de::Error> {
-        let contents =
-            if file.ends_with("bootstrap.toml") || env::var_os("RUST_BOOTSTRAP_CONFIG").is_some() {
-                "profile = \"user\"".to_owned()
-            } else {
-                assert!(file.ends_with("config.dist.toml"));
-                std::fs::read_to_string(file).unwrap()
-            };
+        let contents = if file.ends_with("bootstrap.toml")
+            || file.ends_with("config.toml")
+            || env::var_os("RUST_BOOTSTRAP_CONFIG").is_some()
+        {
+            "profile = \"user\"".to_owned()
+        } else {
+            assert!(file.ends_with("config.dist.toml") || file.ends_with("bootstrap.dist.toml"));
+            std::fs::read_to_string(file).unwrap()
+        };
 
         toml::from_str(&contents).and_then(|table: toml::Value| TomlConfig::deserialize(table))
     }