From 6746af4605b6a32b8daa92ff1505415b802b6203 Mon Sep 17 00:00:00 2001 From: Winni Neessen Date: Tue, 23 Jan 2024 11:21:56 +0100 Subject: [PATCH] Update client tests for message delivery indication This commit adds checks in the testing functions to verify the successful implementation of message delivery status. A new attribute `isDelivered` is now being validated in our tests, reinforcing the message tracking system and enhancing the overall reliability of our application. --- client_test.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/client_test.go b/client_test.go index afc5743..8c35e19 100644 --- a/client_test.go +++ b/client_test.go @@ -763,6 +763,9 @@ func TestClient_DialSendClose(t *testing.T) { if err := c.Close(); err != nil { t.Errorf("Close() failed: %s", err) } + if !m.IsDelivered() { + t.Errorf("message should be delivered but is indicated no to") + } } // TestClient_DialAndSendWithContext tests the DialAndSendWithContext() method of Client @@ -1134,7 +1137,9 @@ func TestClient_DialAndSendWithContext_withSendError(t *testing.T) { } if se.IsTemp() { t.Errorf("expected permanent error but IsTemp() returned true") - return + } + if m.IsDelivered() { + t.Errorf("message is indicated to be delivered but shouldn't") } }