File tree Expand file tree Collapse file tree 1 file changed +12
-12
lines changed Expand file tree Collapse file tree 1 file changed +12
-12
lines changed Original file line number Diff line number Diff line change @@ -209,25 +209,25 @@ fn it_connects_tls_both() {
209209#[ test]
210210fn it_does_not_connect_tls_client_only ( ) {
211211 // Client requesting tls fails as expected when server does not support it.
212- match TestingShim :: new (
212+
213+ let e = TestingShim :: new (
213214 |_, _| unreachable ! ( ) ,
214215 |_| unreachable ! ( ) ,
215216 |_, _, _| unreachable ! ( ) ,
216217 |_, _| unreachable ! ( ) ,
217218 )
218219 . with_client_tls ( )
219220 . test_with_result ( |_| { } )
220- {
221- Ok ( ( ) ) => {
222- panic ! ( "client should not have connected" )
223- }
224- Err ( e) => match e. downcast_ref :: < mysql:: Error > ( ) {
225- Some ( mysql:: Error :: DriverError ( DriverError :: TlsNotSupported ) ) => {
226- // this is what we expect.
227- }
228- _ => panic ! ( "unexpected error {}" , e) ,
229- } ,
230- }
221+ . expect_err ( "client should not have connected" ) ;
222+
223+ assert ! (
224+ matches!(
225+ e. downcast_ref:: <mysql:: Error >( ) ,
226+ Some ( mysql:: Error :: DriverError ( DriverError :: TlsNotSupported ) )
227+ ) ,
228+ "unexpected error {:?}" ,
229+ e
230+ ) ;
231231}
232232
233233#[ test]
You can’t perform that action at this time.
0 commit comments