@@ -7,8 +7,7 @@ use std::{env::consts::EXE_SUFFIX, path::Path};
7
7
8
8
use rustup:: for_host;
9
9
use rustup:: test:: {
10
- CliTestContext , Config , MULTI_ARCH1 , Scenario , print_command, print_indented,
11
- set_current_dist_date, this_host_triple,
10
+ CliTestContext , Config , MULTI_ARCH1 , Scenario , print_command, print_indented, this_host_triple,
12
11
} ;
13
12
use rustup:: utils;
14
13
use rustup:: utils:: raw:: symlink_dir;
@@ -549,7 +548,7 @@ async fn rls_exists_in_toolchain() {
549
548
#[ tokio:: test]
550
549
async fn run_rls_when_not_available_in_toolchain ( ) {
551
550
let mut cx = CliTestContext :: new ( Scenario :: UnavailableRls ) . await ;
552
- set_current_dist_date ( & cx. config , "2015-01-01" ) ;
551
+ cx. config . set_current_dist_date ( "2015-01-01" ) ;
553
552
cx. config . expect_ok ( & [ "rustup" , "default" , "nightly" ] ) . await ;
554
553
cx. config . expect_err (
555
554
& [ "rls" , "--version" ] ,
@@ -560,7 +559,7 @@ async fn run_rls_when_not_available_in_toolchain() {
560
559
) ,
561
560
) . await ;
562
561
563
- set_current_dist_date ( & cx. config , "2015-01-02" ) ;
562
+ cx. config . set_current_dist_date ( "2015-01-02" ) ;
564
563
cx. config . expect_ok ( & [ "rustup" , "update" ] ) . await ;
565
564
cx. config
566
565
. expect_ok ( & [ "rustup" , "component" , "add" , "rls" ] )
@@ -603,7 +602,7 @@ async fn run_rls_when_not_installed_for_nightly() {
603
602
#[ tokio:: test]
604
603
async fn run_rust_lldb_when_not_in_toolchain ( ) {
605
604
let mut cx = CliTestContext :: new ( Scenario :: UnavailableRls ) . await ;
606
- set_current_dist_date ( & cx. config , "2015-01-01" ) ;
605
+ cx. config . set_current_dist_date ( "2015-01-01" ) ;
607
606
cx. config . expect_ok ( & [ "rustup" , "default" , "nightly" ] ) . await ;
608
607
cx. config . expect_err (
609
608
& [ "rust-lldb" , "--version" ] ,
@@ -618,13 +617,13 @@ async fn run_rust_lldb_when_not_in_toolchain() {
618
617
#[ tokio:: test]
619
618
async fn rename_rls_before ( ) {
620
619
let mut cx = CliTestContext :: new ( Scenario :: ArchivesV2 ) . await ;
621
- set_current_dist_date ( & cx. config , "2015-01-01" ) ;
620
+ cx. config . set_current_dist_date ( "2015-01-01" ) ;
622
621
cx. config . expect_ok ( & [ "rustup" , "default" , "nightly" ] ) . await ;
623
622
cx. config
624
623
. expect_ok ( & [ "rustup" , "component" , "add" , "rls" ] )
625
624
. await ;
626
625
627
- set_current_dist_date ( & cx. config , "2015-01-02" ) ;
626
+ cx. config . set_current_dist_date ( "2015-01-02" ) ;
628
627
cx. config . expect_ok ( & [ "rustup" , "update" ] ) . await ;
629
628
630
629
assert ! ( cx. config. exedir. join( format!( "rls{EXE_SUFFIX}" ) ) . exists( ) ) ;
@@ -634,10 +633,10 @@ async fn rename_rls_before() {
634
633
#[ tokio:: test]
635
634
async fn rename_rls_after ( ) {
636
635
let mut cx = CliTestContext :: new ( Scenario :: ArchivesV2 ) . await ;
637
- set_current_dist_date ( & cx. config , "2015-01-01" ) ;
636
+ cx. config . set_current_dist_date ( "2015-01-01" ) ;
638
637
cx. config . expect_ok ( & [ "rustup" , "default" , "nightly" ] ) . await ;
639
638
640
- set_current_dist_date ( & cx. config , "2015-01-02" ) ;
639
+ cx. config . set_current_dist_date ( "2015-01-02" ) ;
641
640
cx. config . expect_ok ( & [ "rustup" , "update" ] ) . await ;
642
641
cx. config
643
642
. expect_ok ( & [ "rustup" , "component" , "add" , "rls-preview" ] )
@@ -650,10 +649,10 @@ async fn rename_rls_after() {
650
649
#[ tokio:: test]
651
650
async fn rename_rls_add_old_name ( ) {
652
651
let mut cx = CliTestContext :: new ( Scenario :: ArchivesV2 ) . await ;
653
- set_current_dist_date ( & cx. config , "2015-01-01" ) ;
652
+ cx. config . set_current_dist_date ( "2015-01-01" ) ;
654
653
cx. config . expect_ok ( & [ "rustup" , "default" , "nightly" ] ) . await ;
655
654
656
- set_current_dist_date ( & cx. config , "2015-01-02" ) ;
655
+ cx. config . set_current_dist_date ( "2015-01-02" ) ;
657
656
cx. config . expect_ok ( & [ "rustup" , "update" ] ) . await ;
658
657
cx. config
659
658
. expect_ok ( & [ "rustup" , "component" , "add" , "rls" ] )
@@ -666,10 +665,10 @@ async fn rename_rls_add_old_name() {
666
665
#[ tokio:: test]
667
666
async fn rename_rls_list ( ) {
668
667
let mut cx = CliTestContext :: new ( Scenario :: ArchivesV2 ) . await ;
669
- set_current_dist_date ( & cx. config , "2015-01-01" ) ;
668
+ cx. config . set_current_dist_date ( "2015-01-01" ) ;
670
669
cx. config . expect_ok ( & [ "rustup" , "default" , "nightly" ] ) . await ;
671
670
672
- set_current_dist_date ( & cx. config , "2015-01-02" ) ;
671
+ cx. config . set_current_dist_date ( "2015-01-02" ) ;
673
672
cx. config . expect_ok ( & [ "rustup" , "update" ] ) . await ;
674
673
cx. config
675
674
. expect_ok ( & [ "rustup" , "component" , "add" , "rls" ] )
@@ -683,10 +682,10 @@ async fn rename_rls_list() {
683
682
#[ tokio:: test]
684
683
async fn rename_rls_preview_list ( ) {
685
684
let mut cx = CliTestContext :: new ( Scenario :: ArchivesV2 ) . await ;
686
- set_current_dist_date ( & cx. config , "2015-01-01" ) ;
685
+ cx. config . set_current_dist_date ( "2015-01-01" ) ;
687
686
cx. config . expect_ok ( & [ "rustup" , "default" , "nightly" ] ) . await ;
688
687
689
- set_current_dist_date ( & cx. config , "2015-01-02" ) ;
688
+ cx. config . set_current_dist_date ( "2015-01-02" ) ;
690
689
cx. config . expect_ok ( & [ "rustup" , "update" ] ) . await ;
691
690
cx. config
692
691
. expect_ok ( & [ "rustup" , "component" , "add" , "rls-preview" ] )
@@ -700,10 +699,10 @@ async fn rename_rls_preview_list() {
700
699
#[ tokio:: test]
701
700
async fn rename_rls_remove ( ) {
702
701
let mut cx = CliTestContext :: new ( Scenario :: ArchivesV2 ) . await ;
703
- set_current_dist_date ( & cx. config , "2015-01-01" ) ;
702
+ cx. config . set_current_dist_date ( "2015-01-01" ) ;
704
703
cx. config . expect_ok ( & [ "rustup" , "default" , "nightly" ] ) . await ;
705
704
706
- set_current_dist_date ( & cx. config , "2015-01-02" ) ;
705
+ cx. config . set_current_dist_date ( "2015-01-02" ) ;
707
706
cx. config . expect_ok ( & [ "rustup" , "update" ] ) . await ;
708
707
709
708
cx. config
@@ -780,10 +779,10 @@ async fn tmp_downloads_symlink() {
780
779
fs:: create_dir ( & test_downloads) . unwrap ( ) ;
781
780
symlink_dir ( & test_downloads, & cx. config . rustupdir . join ( "downloads" ) ) . unwrap ( ) ;
782
781
783
- set_current_dist_date ( & cx. config , "2015-01-01" ) ;
782
+ cx. config . set_current_dist_date ( "2015-01-01" ) ;
784
783
cx. config . expect_ok ( & [ "rustup" , "default" , "nightly" ] ) . await ;
785
784
786
- set_current_dist_date ( & cx. config , "2015-01-02" ) ;
785
+ cx. config . set_current_dist_date ( "2015-01-02" ) ;
787
786
cx. config . expect_ok ( & [ "rustup" , "update" ] ) . await ;
788
787
789
788
assert ! ( cx. config. rustupdir. join( "tmp" ) . exists( ) ) ;
@@ -833,15 +832,15 @@ info: toolchain 'test' uninstalled
833
832
#[ tokio:: test]
834
833
async fn update_unavailable_rustc ( ) {
835
834
let mut cx = CliTestContext :: new ( Scenario :: Unavailable ) . await ;
836
- set_current_dist_date ( & cx. config , "2015-01-01" ) ;
835
+ cx. config . set_current_dist_date ( "2015-01-01" ) ;
837
836
cx. config . expect_ok ( & [ "rustup" , "default" , "nightly" ] ) . await ;
838
837
839
838
cx. config
840
839
. expect_stdout_ok ( & [ "rustc" , "--version" ] , "hash-nightly-1" )
841
840
. await ;
842
841
843
842
// latest nightly is unavailable
844
- set_current_dist_date ( & cx. config , "2015-01-02" ) ;
843
+ cx. config . set_current_dist_date ( "2015-01-02" ) ;
845
844
// update should do nothing
846
845
cx. config . expect_ok ( & [ "rustup" , "update" , "nightly" ] ) . await ;
847
846
cx. config
@@ -853,7 +852,7 @@ async fn update_unavailable_rustc() {
853
852
#[ tokio:: test]
854
853
async fn install_unavailable_platform ( ) {
855
854
let cx = CliTestContext :: new ( Scenario :: Unavailable ) . await ;
856
- set_current_dist_date ( & cx. config , "2015-01-02" ) ;
855
+ cx. config . set_current_dist_date ( "2015-01-02" ) ;
857
856
// explicit attempt to install should fail
858
857
cx. config
859
858
. expect_err (
@@ -889,7 +888,7 @@ async fn install_beta_with_tag() {
889
888
#[ tokio:: test]
890
889
async fn update_nightly_even_with_incompat ( ) {
891
890
let mut cx = CliTestContext :: new ( Scenario :: MissingComponent ) . await ;
892
- set_current_dist_date ( & cx. config , "2019-09-12" ) ;
891
+ cx. config . set_current_dist_date ( "2019-09-12" ) ;
893
892
cx. config . expect_ok ( & [ "rustup" , "default" , "nightly" ] ) . await ;
894
893
895
894
cx. config
@@ -901,7 +900,7 @@ async fn update_nightly_even_with_incompat() {
901
900
cx. config . expect_component_executable ( "rls" ) . await ;
902
901
903
902
// latest nightly is now one that does not have RLS
904
- set_current_dist_date ( & cx. config , "2019-09-14" ) ;
903
+ cx. config . set_current_dist_date ( "2019-09-14" ) ;
905
904
906
905
cx. config . expect_component_executable ( "rls" ) . await ;
907
906
// update should bring us to latest nightly that does
@@ -915,7 +914,7 @@ async fn update_nightly_even_with_incompat() {
915
914
#[ tokio:: test]
916
915
async fn nightly_backtrack_skips_missing ( ) {
917
916
let mut cx = CliTestContext :: new ( Scenario :: MissingNightly ) . await ;
918
- set_current_dist_date ( & cx. config , "2019-09-16" ) ;
917
+ cx. config . set_current_dist_date ( "2019-09-16" ) ;
919
918
cx. config . expect_ok ( & [ "rustup" , "default" , "nightly" ] ) . await ;
920
919
921
920
cx. config
@@ -927,7 +926,7 @@ async fn nightly_backtrack_skips_missing() {
927
926
cx. config . expect_component_executable ( "rls" ) . await ;
928
927
929
928
// rls is missing on latest, nightly is missing on second-to-latest
930
- set_current_dist_date ( & cx. config , "2019-09-18" ) ;
929
+ cx. config . set_current_dist_date ( "2019-09-18" ) ;
931
930
932
931
// update should not change nightly, and should not error
933
932
cx. config . expect_ok ( & [ "rustup" , "update" , "nightly" ] ) . await ;
0 commit comments