File tree 1 file changed +25
-0
lines changed
1 file changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -1046,6 +1046,8 @@ enum ParseMode {
1046
1046
mod tests {
1047
1047
use rustup_macros:: unit_test as test;
1048
1048
1049
+ use crate :: { cli:: common:: set_globals, utils:: raw} ;
1050
+
1049
1051
use super :: * ;
1050
1052
1051
1053
#[ test]
@@ -1248,4 +1250,27 @@ channel = nightly
1248
1250
Ok ( OverrideFileConfigError :: Parsing )
1249
1251
) ) ;
1250
1252
}
1253
+
1254
+ /// Checks that `rust-toolchain.toml` configs can be overridden by `<proxy> +<toolchain>`.
1255
+ /// See: <https://github.com/rust-lang/rustup/issues/3483>
1256
+ #[ test]
1257
+ fn find_override_config_with_toolchain_override ( ) {
1258
+ let cwd = crate :: test:: test_dir ( ) . unwrap ( ) ;
1259
+ let toolchain_file = cwd. path ( ) . join ( "rust-toolchain.toml" ) ;
1260
+ raw:: write_file (
1261
+ & toolchain_file,
1262
+ r#"
1263
+ [toolchain]
1264
+ channel = "nightly"
1265
+ components = [ "rls" ]
1266
+ "# ,
1267
+ )
1268
+ . unwrap ( ) ;
1269
+
1270
+ let mut cfg = set_globals ( true , false ) . unwrap ( ) ;
1271
+ cfg. toolchain_override = Some ( "beta" . try_into ( ) . unwrap ( ) ) ;
1272
+
1273
+ let found_override = cfg. find_override_config ( cwd. path ( ) ) . unwrap ( ) ;
1274
+ assert ! ( dbg!( found_override) . is_none( ) ) ;
1275
+ }
1251
1276
}
You can’t perform that action at this time.
0 commit comments