File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ use crate::response::search_results::SearchResultsNewStyle;
33use crate :: test_case:: TestCase ;
44use crate :: timed_response:: TimedResponse ;
55use crate :: timed_search_results:: TimedSearchResults ;
6- use anyhow:: Result ;
6+ use anyhow:: { Context , Result } ;
77use std:: time:: Duration ;
88
99#[ derive( Clone , Debug , PartialEq ) ]
@@ -31,7 +31,8 @@ impl TestResult {
3131 let json = json?;
3232 match test_case. search_type ( ) {
3333 None => todo ! ( ) ,
34- Some ( search_type) => SearchResultsNewStyle :: new ( search_type, json. as_str ( ) ) ,
34+ Some ( search_type) => SearchResultsNewStyle :: new ( search_type, json. as_str ( ) )
35+ . context ( "Could not extract search results from server response" ) ,
3536 }
3637 }
3738}
@@ -89,7 +90,10 @@ mod tests {
8990 let results =
9091 TestResult :: new_style_results ( & test_case, Ok ( String :: from ( "This is not JSON" ) ) )
9192 . unwrap_err ( ) ;
92- assert_eq ! ( results. to_string( ) , "expected value at line 1 column 1" ) // TODO: Improve error message.
93+ assert_eq ! (
94+ results. to_string( ) ,
95+ "Could not extract search results from server response"
96+ )
9397 }
9498
9599 fn ok_response ( ) -> TimedResponse {
You can’t perform that action at this time.
0 commit comments