File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -3,14 +3,17 @@ use predicates::prelude::*;
33
44#[ test]
55fn test_example_output_default_level ( ) {
6- // This is the canonical way to run an example and test its output.
76 let mut cmd = Command :: new ( "cargo" ) ;
87 cmd. args ( [ "run" , "--example" , "simple" , "--quiet" ] ) ;
98
109 cmd. assert ( )
1110 . stdout ( predicate:: str:: contains ( "hello from the example" ) )
1211 . stdout ( predicate:: str:: contains ( "this is a warning" ) )
1312 . stdout ( predicate:: str:: contains ( "this is an error" ) )
13+ . stdout ( predicate:: str:: contains ( "user signed in" ) )
14+ . stdout ( predicate:: str:: contains ( "cache miss" ) )
15+ . stdout ( predicate:: str:: contains ( "db failure" ) )
16+ . stdout ( predicate:: str:: contains ( "loaded config" ) . not ( ) ) // debug only
1417 . stdout ( predicate:: str:: contains ( "this is a debug message" ) . not ( ) )
1518 . success ( ) ;
1619}
@@ -23,6 +26,7 @@ fn test_example_output_debug_level() {
2326
2427 cmd. assert ( )
2528 . stdout ( predicate:: str:: contains ( "this is a debug message" ) )
29+ . stdout ( predicate:: str:: contains ( "loaded config" ) )
2630 . success ( ) ;
2731}
2832
You can’t perform that action at this time.
0 commit comments