@@ -33,7 +33,9 @@ pub fn any_failed(results: &[ProviderResult]) -> bool {
3333 . any ( |r| matches ! ( r. status, Status :: Failed ( _) ) )
3434}
3535
36- /// Render the results as an aligned table plus a summary line.
36+ /// Render an aligned table and summary. Failure reasons are listed below the
37+ /// table (not in the `RESULT` column) so a long or multi-line error can't break
38+ /// the alignment.
3739pub fn render ( results : & [ ProviderResult ] ) -> String {
3840 if results. is_empty ( ) {
3941 return "No foreign chains configured — nothing to check.\n " . to_string ( ) ;
@@ -42,15 +44,15 @@ pub fn render(results: &[ProviderResult]) -> String {
4244 let chain_w = results
4345 . iter ( )
4446 . map ( |r| r. chain . len ( ) )
45- . chain ( std:: iter:: once ( "CHAIN" . len ( ) ) )
4647 . max ( )
47- . unwrap_or ( 0 ) ;
48+ . unwrap_or ( 0 )
49+ . max ( "CHAIN" . len ( ) ) ;
4850 let provider_w = results
4951 . iter ( )
5052 . map ( |r| r. provider . len ( ) )
51- . chain ( std:: iter:: once ( "PROVIDER" . len ( ) ) )
5253 . max ( )
53- . unwrap_or ( 0 ) ;
54+ . unwrap_or ( 0 )
55+ . max ( "PROVIDER" . len ( ) ) ;
5456
5557 let mut out = String :: new ( ) ;
5658 let _ = writeln ! (
@@ -66,9 +68,9 @@ pub fn render(results: &[ProviderResult]) -> String {
6668 passed += 1 ;
6769 "✓ ok" . to_string ( )
6870 }
69- Status :: Failed ( reason ) => {
71+ Status :: Failed ( _ ) => {
7072 failed += 1 ;
71- format ! ( "✗ {reason}" )
73+ "✗ failed" . to_string ( )
7274 }
7375 Status :: Skipped ( reason) => {
7476 skipped += 1 ;
@@ -82,7 +84,17 @@ pub fn render(results: &[ProviderResult]) -> String {
8284 ) ;
8385 }
8486
85- let _ = writeln ! ( out, "\n {passed} passed, {failed} failed, {skipped} skipped" , ) ;
87+ let _ = writeln ! ( out, "\n {passed} passed, {failed} failed, {skipped} skipped" ) ;
88+
89+ if failed > 0 {
90+ let _ = writeln ! ( out, "\n Failures:" ) ;
91+ for r in results {
92+ if let Status :: Failed ( reason) = & r. status {
93+ let _ = writeln ! ( out, " {} / {}: {reason}" , r. chain, r. provider) ;
94+ }
95+ }
96+ }
97+
8698 out
8799}
88100
0 commit comments