-
Notifications
You must be signed in to change notification settings - Fork 214
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make topic headers case-insensitive #1106
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
@@ -1704,6 +1704,25 @@ void main() { | |||||||||
} | ||||||||||
}); | ||||||||||
}); | ||||||||||
group('topics compared case-insensitively', () { | ||||||||||
Comment on lines
1706
to
+1707
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: nest this inside the haveSameRecipient group |
||||||||||
void doTest(String description, String topicA, String topicB, bool expected) { | ||||||||||
test(description, () { | ||||||||||
final stream = eg.stream(); | ||||||||||
final messageA = eg.streamMessage(stream: stream, topic: topicA); | ||||||||||
final messageB = eg.streamMessage(stream: stream, topic: topicB); | ||||||||||
check(haveSameRecipient(messageA, messageB)).equals(expected); | ||||||||||
}); | ||||||||||
} | ||||||||||
|
||||||||||
doTest('same case, all lower', 'abc', 'abc', true); | ||||||||||
doTest('same case, all upper', 'ABC', 'ABC', true); | ||||||||||
doTest('same case, mixed', 'AbC', 'AbC', true); | ||||||||||
doTest('same non-letter chars', '嗎', '嗎', true); | ||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Calling this character "non-letter" is confusing, because Unicode in fact classifies it in its "Letter" category, specifically "Lo (Letter, Other)":
(By comparison, cased letters like |
||||||||||
doTest('different case', 'aBc', 'ABC', true); | ||||||||||
doTest('different case, same diacritics', 'AbÇ', 'aBç', true); | ||||||||||
doTest('same letters, different diacritics', 'ma', 'mǎ', false); | ||||||||||
doTest('having different non-letter chars', 'ma 嗎', 'mǎ 馬', false); | ||||||||||
Comment on lines
+1723
to
+1724
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
(plus the renaming above) Otherwise the last test doesn't really exercise the comparison of the two sinographs — the two names are already going to be different because of the "a" vs "ǎ". |
||||||||||
}); | ||||||||||
|
||||||||||
test('messagesSameDay', () { | ||||||||||
// These timestamps will differ depending on the timezone of the | ||||||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: separate with blank line