File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -1449,6 +1449,26 @@ mod tests {
14491449 "### )
14501450 }
14511451
1452+ #[ test]
1453+ fn only_help_and_note ( ) {
1454+ let source = "this should not be printed" ;
1455+ let msg = Report :: < Range < usize > > :: build ( ReportKind :: Error , ( ) , 0 )
1456+ . with_config ( no_color ( ) )
1457+ . with_message ( "Programming language \" Rest\" not found" )
1458+ . with_help ( "a language with a similar name exists: Rust" )
1459+ . with_note ( "perhaps you'd like some sleep?" )
1460+ . finish ( )
1461+ . write_to_string ( Source :: from ( source) ) ;
1462+ assert_snapshot ! ( msg, @r###"
1463+ Error: Programming language "Rest" not found
1464+ │
1465+ │ Help: a language with a similar name exists: Rust
1466+ │
1467+ │ Note: perhaps you'd like some sleep?
1468+ ──╯
1469+ "### )
1470+ }
1471+
14521472 #[ test]
14531473 fn multi_source ( ) {
14541474 let msg = Report :: build ( ReportKind :: Error , 0usize , 0 )
You can’t perform that action at this time.
0 commit comments