Skip to content
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

Improve QueryTypeFilter unit test #461

Merged
merged 1 commit into from
Jan 23, 2022
Merged

Conversation

rukai
Copy link
Member

@rukai rukai commented Jan 20, 2022

Cleanup inspired by the message details rewrite.

Main purpose is to replace this logic:

        let any = result.iter().find(|m| {
            if let MessageDetails::Response(qr) = &m.details {
                if let Some(qm) = &qr.matching_query {
                    return qm.query_type == QueryType::Read;
                }
            }

            false
        });

        assert_eq!(any, None);

Which is very confusing to read and not a very robust test.

Copy link
Contributor

@Claude-at-Instaclustr Claude-at-Instaclustr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@rukai rukai requested a review from conorbros January 23, 2022 23:00
@conorbros conorbros merged commit 699a974 into shotover:main Jan 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants