@@ -67,6 +67,50 @@ fn rustup_only_options() {
6767 test_error ( "rustup_only_options" , & [ "-q" ] ) ;
6868}
6969
70+ #[ tokio:: test]
71+ async fn rustup_check_updates_none ( ) {
72+ let name = "rustup_check_updates_none" ;
73+ let cx = CliTestContext :: new ( Scenario :: SimpleV2 ) . await ;
74+ cx. config
75+ . expect ( [ "rustup" , "toolchain" , "add" , "stable" , "beta" , "nightly" ] )
76+ . await
77+ . is_ok ( ) ;
78+ cx. config
79+ . expect_with_env ( [ "rustup" , "check" ] , [ ( "RUSTUP_TERM_COLOR" , "always" ) ] )
80+ . await
81+ . with_stdout ( Data :: read_from (
82+ Path :: new ( & format ! ( "tests/suite/cli_rustup_ui/{name}.stdout.term.svg" ) ) ,
83+ None ,
84+ ) )
85+ . with_stderr ( "" )
86+ . is_err ( ) ;
87+ }
88+
89+ #[ tokio:: test]
90+ async fn rustup_check_updates_some ( ) {
91+ let name = "rustup_check_updates_some" ;
92+ let mut cx = CliTestContext :: new ( Scenario :: None ) . await ;
93+
94+ {
95+ let cx = cx. with_dist_dir ( Scenario :: ArchivesV2_2015_01_01 ) ;
96+ cx. config
97+ . expect ( [ "rustup" , "toolchain" , "add" , "stable" , "beta" , "nightly" ] )
98+ . await
99+ . is_ok ( ) ;
100+ }
101+
102+ let cx = cx. with_dist_dir ( Scenario :: SimpleV2 ) ;
103+ cx. config
104+ . expect_with_env ( [ "rustup" , "check" ] , [ ( "RUSTUP_TERM_COLOR" , "always" ) ] )
105+ . await
106+ . with_stdout ( Data :: read_from (
107+ Path :: new ( & format ! ( "tests/suite/cli_rustup_ui/{name}.stdout.term.svg" ) ) ,
108+ None ,
109+ ) )
110+ . with_stderr ( "" )
111+ . is_ok ( ) ;
112+ }
113+
70114#[ test]
71115fn rustup_check_cmd_help_flag ( ) {
72116 test_help ( "rustup_check_cmd_help_flag" , & [ "check" , "--help" ] ) ;
0 commit comments