From 4947842989858c3d11fe5bf2b62bec818ffa920b Mon Sep 17 00:00:00 2001 From: Shivansh Sharma Date: Sat, 7 Dec 2024 01:22:10 +0530 Subject: [PATCH] Tests: Add test for case-insensitive topic headers Add test case in the commit to verify that message list topic headers handle case-insensitive topic comparison correctly, ensuring messages with topics that differ only in case (like "hello world" and "Hello World") --- test/model/message_list_test.dart | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/test/model/message_list_test.dart b/test/model/message_list_test.dart index 9215e497e2..63426ddd6b 100644 --- a/test/model/message_list_test.dart +++ b/test/model/message_list_test.dart @@ -1703,6 +1703,23 @@ void main() { } } }); + test('stream messages match with case-insensitive topics', () { + final stream = eg.stream(); + final messageLower = eg.streamMessage( + stream: stream, + topic: 'hello world'); + final messageUpper = eg.streamMessage( + stream: stream, + topic: 'Hello World'); + final messageDiff = eg.streamMessage( + stream: stream, + topic: 'different'); + + check(haveSameRecipient(messageLower, messageUpper)).isTrue(); + check(haveSameRecipient(messageUpper, messageLower)).isTrue(); + check(haveSameRecipient(messageLower, messageDiff)).isFalse(); + check(haveSameRecipient(messageUpper, messageDiff)).isFalse(); + }); }); test('messagesSameDay', () {