File tree Expand file tree Collapse file tree
rsworkspace/crates/acp-nats/src/client Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -365,6 +365,18 @@ mod tests {
365365 fn terminal_wait_for_exit_error_display ( ) {
366366 let err = TerminalWaitForExitError :: TimedOut ;
367367 assert ! ( err. to_string( ) . contains( "Timed out" ) ) ;
368+ let json_err =
369+ TerminalWaitForExitError :: MalformedJson ( serde_json:: from_str :: < ( ) > ( "{" ) . unwrap_err ( ) ) ;
370+ assert ! ( json_err. to_string( ) . contains( "malformed JSON" ) ) ;
371+ let params_err = TerminalWaitForExitError :: InvalidParams (
372+ agent_client_protocol:: Error :: new ( -32602 , "bad params" ) ,
373+ ) ;
374+ assert ! ( params_err. to_string( ) . contains( "invalid params" ) ) ;
375+ let client_err = TerminalWaitForExitError :: ClientError ( agent_client_protocol:: Error :: new (
376+ -32603 ,
377+ "client failed" ,
378+ ) ) ;
379+ assert ! ( client_err. to_string( ) . contains( "client error" ) ) ;
368380 }
369381
370382 #[ test]
@@ -374,5 +386,14 @@ mod tests {
374386 let json_err =
375387 TerminalWaitForExitError :: MalformedJson ( serde_json:: from_str :: < ( ) > ( "{" ) . unwrap_err ( ) ) ;
376388 assert ! ( json_err. source( ) . is_some( ) ) ;
389+ let params_err = TerminalWaitForExitError :: InvalidParams (
390+ agent_client_protocol:: Error :: new ( -32602 , "bad params" ) ,
391+ ) ;
392+ assert ! ( params_err. source( ) . is_some( ) ) ;
393+ let client_err = TerminalWaitForExitError :: ClientError ( agent_client_protocol:: Error :: new (
394+ -32603 ,
395+ "client failed" ,
396+ ) ) ;
397+ assert ! ( client_err. source( ) . is_some( ) ) ;
377398 }
378399}
You can’t perform that action at this time.
0 commit comments