From 88b652c07a5ba337db9e03a2363c8af435254228 Mon Sep 17 00:00:00 2001 From: Zeeshan Ali Khan Date: Sat, 29 Jun 2024 16:22:17 +0200 Subject: [PATCH] =?UTF-8?q?=E2=9C=85=20zb:=20Check=20errors=20from=20falli?= =?UTF-8?q?ble=20methods=20in=20e2e=20test?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- zbus/tests/e2e.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/zbus/tests/e2e.rs b/zbus/tests/e2e.rs index 96b231aa5..f1a39ee31 100644 --- a/zbus/tests/e2e.rs +++ b/zbus/tests/e2e.rs @@ -84,7 +84,7 @@ impl MyIface { } /// Custom D-Bus error type. -#[derive(Debug, DBusError)] +#[derive(Debug, DBusError, PartialEq)] #[zbus(prefix = "org.freedesktop.MyIface.Error")] enum MyIfaceError { SomethingWentWrong(String), @@ -569,6 +569,13 @@ async fn my_iface_test(conn: Connection, event: Event) -> zbus::Result { bar: "TestString".into(), }) .await?; + + proxy.test_error().await.unwrap_err(); + assert_eq!( + proxy.test_custom_error().await.unwrap_err(), + MyIfaceError::SomethingWentWrong("oops".to_string()) + ); + check_hash_map(proxy.test_hashmap_return().await?); check_hash_map(proxy.hash_map().await?); proxy