@@ -847,22 +847,27 @@ fn show_toolchain_override_not_installed() {
847
847
#[ test]
848
848
fn override_set_unset_with_path ( ) {
849
849
setup ( & |config| {
850
- let workdir = config. current_dir ( ) ;
851
- let workdir = workdir. to_string_lossy ( ) ;
850
+ let cwd = fs:: canonicalize ( config. current_dir ( ) ) . unwrap ( ) ;
851
+ let mut cwd_str = cwd. to_str ( ) . unwrap ( ) ;
852
+
853
+ if cfg ! ( windows) {
854
+ cwd_str = & cwd_str[ 4 ..] ;
855
+ }
856
+
852
857
config. change_dir ( & config. emptydir , & || {
853
858
expect_ok (
854
859
config,
855
- & [ "rustup" , "override" , "set" , "nightly" , "--path" , & workdir ] ,
860
+ & [ "rustup" , "override" , "set" , "nightly" , "--path" , cwd_str ] ,
856
861
) ;
857
862
} ) ;
858
863
expect_ok_ex (
859
864
config,
860
865
& [ "rustup" , "override" , "list" ] ,
861
- & format ! ( "{}\t nightly-{}\n " , & workdir , this_host_triple( ) ) ,
866
+ & format ! ( "{}\t nightly-{}\n " , cwd_str , this_host_triple( ) ) ,
862
867
r"" ,
863
868
) ;
864
869
config. change_dir ( & config. emptydir , & || {
865
- expect_ok ( config, & [ "rustup" , "override" , "unset" , "--path" , & workdir ] ) ;
870
+ expect_ok ( config, & [ "rustup" , "override" , "unset" , "--path" , cwd_str ] ) ;
866
871
} ) ;
867
872
expect_ok_ex (
868
873
config,
0 commit comments