@@ -82,11 +82,13 @@ fn multi_line_formatting() {
8282 let error = SuperError { source : SuperErrorSideKick } ;
8383 let report = Report :: new ( & error) . pretty ( true ) ;
8484 let actual = report. to_string ( ) ;
85- let expected = String :: from ( "\
85+ let expected = String :: from (
86+ "\
8687 SuperError is here!
8788
8889Caused by:
89- SuperErrorSideKick is here!" ) ;
90+ SuperErrorSideKick is here!" ,
91+ ) ;
9092
9193 assert_eq ! ( expected, actual) ;
9294}
@@ -112,43 +114,47 @@ fn error_with_no_sources_formats_multi_line_correctly() {
112114#[ test]
113115fn error_with_backtrace_outputs_correctly_with_one_source ( ) {
114116 let trace = Backtrace :: force_capture ( ) ;
115- let expected = format ! ( "\
117+ let expected = format ! (
118+ "\
116119 The source of the error
117120
118121Caused by:
119122 Error with backtrace
120123
121124Stack backtrace:
122- {}" , trace) ;
125+ {}" ,
126+ trace
127+ ) ;
123128 let error = GenericError :: new ( "Error with backtrace" ) ;
124129 let mut error = GenericError :: new_with_source ( "The source of the error" , error) ;
125130 error. backtrace = Some ( trace) ;
126131 let report = Report :: new ( error) . pretty ( true ) . show_backtrace ( true ) ;
127132
128-
129133 println ! ( "Error: {}" , report) ;
130134 assert_eq ! ( expected. trim_end( ) , report. to_string( ) ) ;
131135}
132136
133137#[ test]
134138fn error_with_backtrace_outputs_correctly_with_two_sources ( ) {
135139 let trace = Backtrace :: force_capture ( ) ;
136- let expected = format ! ( "\
140+ let expected = format ! (
141+ "\
137142 Error with two sources
138143
139144Caused by:
140145 0: The source of the error
141146 1: Error with backtrace
142147
143148Stack backtrace:
144- {}" , trace) ;
149+ {}" ,
150+ trace
151+ ) ;
145152 let mut error = GenericError :: new ( "Error with backtrace" ) ;
146153 error. backtrace = Some ( trace) ;
147154 let error = GenericError :: new_with_source ( "The source of the error" , error) ;
148155 let error = GenericError :: new_with_source ( "Error with two sources" , error) ;
149156 let report = Report :: new ( error) . pretty ( true ) . show_backtrace ( true ) ;
150157
151-
152158 println ! ( "Error: {}" , report) ;
153159 assert_eq ! ( expected. trim_end( ) , report. to_string( ) ) ;
154160}
@@ -313,11 +319,11 @@ The message
313319
314320
315321Caused by:
316- 0:
317- The message
318-
319- 1:
320- The message
322+ 0: \
323+ \n The message
324+ \
325+ \n 1: \
326+ \n The message
321327 " ;
322328
323329 let actual = report. to_string ( ) ;
@@ -399,11 +405,11 @@ line 2
399405
400406Caused by:
401407 0: line 1
402-
403- line 2
408+ \
409+ \n line 2
404410 1: line 1
405-
406- line 2" ;
411+ \
412+ \n line 2";
407413
408414 let actual = report. to_string ( ) ;
409415 assert_eq ! ( expected, actual) ;
0 commit comments