Commit 81157af 1 parent 759a44e commit 81157af Copy full SHA for 81157af
File tree 1 file changed +22
-0
lines changed
1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -1605,6 +1605,28 @@ mod tests {
1605
1605
" )
1606
1606
}
1607
1607
1608
+ #[ test]
1609
+ fn only_help_and_note ( ) {
1610
+ let source = "this should not be printed" ;
1611
+ let msg = remove_trailing (
1612
+ Report :: build ( ReportKind :: Error , 0 ..0 )
1613
+ . with_config ( no_color ( ) )
1614
+ . with_message ( "Programming language \" Rest\" not found" )
1615
+ . with_help ( "a language with a similar name exists: Rust" )
1616
+ . with_note ( "perhaps you'd like some sleep?" )
1617
+ . finish ( )
1618
+ . write_to_string ( Source :: from ( source) ) ,
1619
+ ) ;
1620
+ assert_snapshot ! ( msg, @r###"
1621
+ Error: Programming language "Rest" not found
1622
+ │
1623
+ │ Help: a language with a similar name exists: Rust
1624
+ │
1625
+ │ Note: perhaps you'd like some sleep?
1626
+ ──╯
1627
+ "### )
1628
+ }
1629
+
1608
1630
#[ test]
1609
1631
fn multi_source ( ) {
1610
1632
let msg = remove_trailing (
You can’t perform that action at this time.
0 commit comments