1 use super::{Config, TomlConfig};
4 fn toml(config: &str) -> impl '_ + Fn(&Path) -> TomlConfig {
5 |&_| toml::from_str(config).unwrap()
8 fn parse(config: &str) -> Config {
9 Config::parse_inner(&["check".to_owned(), "--config=/does/not/exist".to_owned()], toml(config))
13 fn download_ci_llvm() {
14 let parse_llvm = |s| parse(s).llvm_from_ci;
15 let if_available = parse_llvm("llvm.download-ci-llvm = \"if-available\"");
17 assert!(parse_llvm("llvm.download-ci-llvm = true"));
18 assert!(!parse_llvm("llvm.download-ci-llvm = false"));
19 assert_eq!(parse_llvm(""), if_available);
20 assert_eq!(parse_llvm("rust.channel = \"dev\""), if_available);
21 assert!(!parse_llvm("rust.channel = \"stable\""));
24 // FIXME: add test for detecting `src` and `out`