about summary refs log tree commit diff
path: root/src/bootstrap/config
diff options
context:
space:
mode:
authorclubby789 <jamie@hill-daniel.co.uk>2023-06-26 20:17:08 +0000
committerclubby789 <jamie@hill-daniel.co.uk>2023-06-26 22:54:47 +0000
commit85c4ea0138fcca2e8cf4515a063cd3b762d64aec (patch)
treea5c9843279acbf237b25b5bdeecda579cc833aec /src/bootstrap/config
parent6f8c27ae89dfd32895419d7ef5b89844bcad1bcd (diff)
downloadrust-85c4ea0138fcca2e8cf4515a063cd3b762d64aec.tar.gz
rust-85c4ea0138fcca2e8cf4515a063cd3b762d64aec.zip
bootstrap: rename 'user' profile to 'dist'
Diffstat (limited to 'src/bootstrap/config')
-rw-r--r--src/bootstrap/config/tests.rs19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/bootstrap/config/tests.rs b/src/bootstrap/config/tests.rs
index 4de84b543ed..3bee659abd1 100644
--- a/src/bootstrap/config/tests.rs
+++ b/src/bootstrap/config/tests.rs
@@ -1,5 +1,8 @@
+use crate::config::TomlConfig;
+
 use super::{Config, Flags};
 use clap::CommandFactory;
+use serde::Deserialize;
 use std::{env, path::Path};
 
 fn parse(config: &str) -> Config {
@@ -159,3 +162,19 @@ fn override_toml_duplicate() {
         |&_| toml::from_str("changelog-seen = 0").unwrap(),
     );
 }
+
+#[test]
+fn profile_user_dist() {
+    fn get_toml(file: &Path) -> TomlConfig {
+        let contents = if file.ends_with("config.toml") {
+            "profile = \"user\"".to_owned()
+        } else {
+            assert!(file.ends_with("config.dist.toml"));
+            std::fs::read_to_string(dbg!(file)).unwrap()
+        };
+        toml::from_str(&contents)
+            .and_then(|table: toml::Value| TomlConfig::deserialize(table))
+            .unwrap()
+    }
+    Config::parse_inner(&["check".to_owned()], get_toml);
+}