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

test: move more tests and add matcher impl #4380

Merged
merged 4 commits into from Dec 21, 2022

Conversation

jackgerrits
Copy link
Member

No description provided.


auto lhs_score = std::get<0>(arg).score;
auto rhs_score = std::get<1>(arg).score;
testing::Matcher<float> score_matcher = testing::FloatEq(lhs_score);
Copy link
Collaborator

Choose a reason for hiding this comment

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

should this be equal or near?

Copy link
Member Author

Choose a reason for hiding this comment

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

Near takes a tolerance, float eq checks they are approximately equal. In my testing this has proven to work well and remove the need for us to define a tolerance.

Copy link
Collaborator

Choose a reason for hiding this comment

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

ok lets see how it goes

Copy link
Member Author

Choose a reason for hiding this comment

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

It will be really easy to add a tolerance to this matcher if we need it. We change MATCHER to MATCHER_P and it takes an arg we can use as tolerance

@jackgerrits jackgerrits merged commit 292ae75 into VowpalWabbit:master Dec 21, 2022
@jackgerrits jackgerrits deleted the move_more_tests branch December 21, 2022 16:14
lalo pushed a commit that referenced this pull request Dec 21, 2022
* test: move more tests and add matcher impl

* format

* unused arg
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.

None yet

2 participants