-
-
Notifications
You must be signed in to change notification settings - Fork 7
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
Create eyeball-im-util with FilteredVectorSubscriber API #19
Conversation
It's not intuitive, but the stream output is correct. It may be changed later.
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.
Looks interesting! I've found a few places where there could be invalid subtracts (unless I'm missing something), can you add tests for those please?
Also, I think there might be a way to make all this code more robust, by testing invariants. Say something like fn assert_invariants
, that would be either debug only (or guarded behind a compile-time cargo feature, enabled in tests only), that would check the following at the end of each handle_
function call:
- indices in
filtered_indices
are unique (don't appear twice or more) - indices in
filtered_indices
refer to values that are in the original array, and those values pass the filter check
What do you think? This might mean storing more of the original array too, but at least for testing purposes, something akin to that would be useful and increase the confidence in this new code IMO.
I think testing invariants would be nice, but I don't think doing it as part of the regular non- A good way to do invariant testing would be adding another test suite IMO (as unit tests that can access internal stat), using the I'd prefer not blocking this PR on extra testing though.. We don't intend to use it in places where it would be a huge issue for some bugs to be present, right? And if there are bugs, they'll likely be pretty obvious (i.e. lead to a panic). |
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.
I probably like it too much, thank you!
No description provided.