should_panic can take expected error strings
connect(client_conn, server_conn, Some(ExpectedError::UntrustedServer), true);
}
#[test]
-#[should_panic]
+#[should_panic(expected = "InvalidKey")]
fn auth_client_key_one_bad() {
// Server requires authentication, client is invalid, expected failure
let client_conn = OssuaryConnection::new(ConnectionType::Client, Some(CLIENT_SECRET.clone())).unwrap();
connect(client_conn, server_conn, Some(ExpectedError::UntrustedServer), true);
}
#[test]
-#[should_panic]
+#[should_panic(expected = "InvalidKey")]
fn auth_client_key_many_bad() {
// Server requires authentication, client is invalid, expected failure
let client_conn = OssuaryConnection::new(ConnectionType::Client, Some(CLIENT_SECRET.clone())).unwrap();
connect(client_conn, server_conn, None, false);
}
#[test]
-#[should_panic]
+#[should_panic(expected = "Untrusted server")]
fn auth_server_key_bad() {
// Client require authentication, expected failure
let mut client_conn = OssuaryConnection::new(ConnectionType::Client, None).unwrap();
connect(client_conn, server_conn, None, false);
}
#[test]
-#[should_panic]
+#[should_panic(expected = "Untrusted server")]
fn auth_client_server_keys_bad() {
// Server and client require authentication, expected failure
let mut client_conn = OssuaryConnection::new(ConnectionType::Client, Some(CLIENT_SECRET.clone())).unwrap();