-
Notifications
You must be signed in to change notification settings - Fork 312
test: Use random email in eg.user #940
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
Conversation
84007a2
to
4f6f236
Compare
4f6f236
to
7627a1b
Compare
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.
Thanks! LGTM with one suggestion below; marking for Greg's review.
test/example_data.dart
Outdated
@@ -70,13 +70,21 @@ GetServerSettingsResult serverSettings({ | |||
int _nextUserId() => (_lastUserId += 1 + Random().nextInt(100)); | |||
int _lastUserId = 1000; | |||
|
|||
/// A random email address, unique from previously generated ones. |
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.
/// A random email address, unique from previously generated ones. | |
/// A random email address, different from previously generated ones. |
7627a1b
to
3ee9069
Compare
This specifically fixes a test data realism issue of the test "find account among several" in `test/notifications/display_test.dart` due to duplicate email addresses within a realm. This also useful in general in cases when the email addresses do not matter and should be kept boring. The generation uses an increasing sequence to make collision unlikely (still possible with caller specified values). Signed-off-by: Zixuan James Li <zixuan@zulip.com>
Thanks @PIG208 for the fix, and @chrisbobbe for the previous review! Looks good; merging, with one docs tweak: -/// If `deliveryEmail` is not given, it will be generated from a random
-/// but unique sequence of strings.
+/// If `deliveryEmail` is not given, it will be generated from a
+/// random sequence of distinct strings. For me saying the sequence is unique would mean that it's distinct from other sequences; instead we mean that all its elements are unique, i.e. distinct from each other. |
3ee9069
to
d1a2538
Compare
This specifically fixes a test data realism issue of the test "find account among several" in
test/notifications/display_test.dart
due to duplicate email addresses within a realm. This also useful in general in cases when the email addresses do not matter and should be kept boring.The generation uses an increasing sequence to make collision unlikely (still possible with caller specified values).
This is taken from #934 and similar to #932.