Skip to content

Commit

Permalink
Tests: Add test for case-insensitive topic headers
Browse files Browse the repository at this point in the history
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")
  • Loading branch information
shivanshsharma13 committed Dec 6, 2024
1 parent 39ee766 commit 4947842
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions test/model/message_list_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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', () {
Expand Down

0 comments on commit 4947842

Please sign in to comment.