File tree Expand file tree Collapse file tree 2 files changed +43
-2
lines changed Expand file tree Collapse file tree 2 files changed +43
-2
lines changed Original file line number Diff line number Diff line change @@ -919,8 +919,8 @@ impl Config {
919919 ( Some ( true ) , Some ( true ) ) => {
920920 bail ! ( "cannot set both `term.verbose` and `term.quiet`" )
921921 }
922- ( Some ( true ) , Some ( false ) ) => Verbosity :: Verbose ,
923- ( Some ( false ) , Some ( true ) ) => Verbosity :: Quiet ,
922+ ( Some ( true ) , _ ) => Verbosity :: Verbose ,
923+ ( _ , Some ( true ) ) => Verbosity :: Quiet ,
924924 _ => Verbosity :: Normal ,
925925 } ,
926926 } ;
Original file line number Diff line number Diff line change @@ -88,6 +88,47 @@ fn verbose_arg_and_quiet_config() {
8888 . run ( ) ;
8989}
9090
91+ #[ cargo_test]
92+ fn quiet_config_alone ( ) {
93+ let p = project ( )
94+ . file (
95+ ".cargo/config" ,
96+ r#"
97+ [term]
98+ quiet = true
99+ "# ,
100+ )
101+ . file ( "src/main.rs" , r#"fn main() { println!("hello"); }"# )
102+ . build ( ) ;
103+
104+ p. cargo ( "run" ) . with_stderr ( "" ) . with_stdout ( "hello" ) . run ( ) ;
105+ }
106+
107+ #[ cargo_test]
108+ fn verbose_config_alone ( ) {
109+ let p = project ( )
110+ . file (
111+ ".cargo/config" ,
112+ r#"
113+ [term]
114+ verbose = true
115+ "# ,
116+ )
117+ . file ( "src/main.rs" , r#"fn main() { println!("hello"); }"# )
118+ . build ( ) ;
119+
120+ p. cargo ( "run" )
121+ . with_stderr (
122+ "\
123+ [COMPILING] foo v0.0.1 ([CWD])
124+ [RUNNING] `rustc [..]
125+ [FINISHED] dev [unoptimized + debuginfo] target(s) in [..]
126+ [RUNNING] `target/debug/foo[EXE]`" ,
127+ )
128+ . with_stdout ( "hello" )
129+ . run ( ) ;
130+ }
131+
91132#[ cargo_test]
92133fn quiet_config_and_verbose_config ( ) {
93134 let p = project ( )
You can’t perform that action at this time.
0 commit comments