@@ -991,6 +991,7 @@ pub mod test {
991991    use  std:: path:: PathBuf ; 
992992    use  std:: process; 
993993    use  std:: sync:: { Arc ,  Mutex } ; 
994+     use  std:: fmt; 
994995
995996    #[ derive( Debug ,  Serialize ,  Deserialize ,  PartialEq ,  Eq ,  Clone ) ]  
996997    pub  struct  Test  { 
@@ -1106,7 +1107,7 @@ pub mod test {
11061107        } 
11071108    } 
11081109
1109-     #[ derive( Debug ,   Serialize ,   Deserialize ,   PartialEq ,  Eq ) ]  
1110+     #[ derive( PartialEq ,  Eq ) ]  
11101111    pub  struct  TestFailure  { 
11111112        /// The test case, indicating file, line, and column 
11121113pub  test :  Test , 
@@ -1123,6 +1124,21 @@ pub mod test {
11231124pub  actual_data :  Result < Result < Vec < MarkedString > ,  String > ,  ( ) > , 
11241125    } 
11251126
1127+     impl  fmt:: Debug  for  TestFailure  { 
1128+         fn  fmt ( & self ,  fmt :  & mut  fmt:: Formatter < ' _ > )  -> fmt:: Result  { 
1129+             fmt. debug_struct ( "TestFailure" ) 
1130+                 . field ( "test" ,  & self . test ) 
1131+                 . field ( "expect_file" ,  & self . expect_file ) 
1132+                 . field ( "actual_file" ,  & self . actual_file ) 
1133+                 . finish ( ) ?; 
1134+ 
1135+             let  expected = format ! ( "{:#?}" ,  self . expect_data) ; 
1136+             let  actual = format ! ( "{:#?}" ,  self . actual_data) ; 
1137+             write ! ( fmt,  "-diff: {}" ,  difference:: Changeset :: new( & expected,  & actual,  "" ) ) 
1138+         } 
1139+     } 
1140+ 
1141+ 
11261142    #[ derive( Clone ,  Default ) ]  
11271143    pub  struct  LineOutput  { 
11281144        req_id :  Arc < Mutex < u64 > > , 
@@ -2117,7 +2133,7 @@ pub mod test {
21172133            Ok ( ( ) ) 
21182134        }  else  { 
21192135            eprintln ! ( "{}\n \n " ,  out. reset( ) . join( "\n " ) ) ; 
2120-             eprintln ! ( "{:#?}\n \n " ,  failures) ; 
2136+             eprintln ! ( "Failures ( \x1b [91mexpected \x1b [92mactual \x1b [0m):  {:#?}\n \n " ,  failures) ; 
21212137            Err ( format ! ( "{} of {} tooltip tests failed" ,  failures. len( ) ,  tests. len( ) ) . into ( ) ) 
21222138        } 
21232139    } 
@@ -2172,7 +2188,7 @@ pub mod test {
21722188            Ok ( ( ) ) 
21732189        }  else  { 
21742190            eprintln ! ( "{}\n \n " ,  out. reset( ) . join( "\n " ) ) ; 
2175-             eprintln ! ( "{:#?}\n \n " ,  failures) ; 
2191+             eprintln ! ( "Failures ( \x1b [91mexpected \x1b [92mactual \x1b [0m):  {:#?}\n \n " ,  failures) ; 
21762192            Err ( format ! ( "{} of {} tooltip tests failed" ,  failures. len( ) ,  tests. len( ) ) . into ( ) ) 
21772193        } 
21782194    } 
0 commit comments