Skip to content

Added two PartialEq-related tests#1572

Closed
kelleyvanevert wants to merge 1 commit intoexercism:mainfrom
kelleyvanevert:patch-1
Closed

Added two PartialEq-related tests#1572
kelleyvanevert wants to merge 1 commit intoexercism:mainfrom
kelleyvanevert:patch-1

Conversation

@kelleyvanevert
Copy link
Copy Markdown

In a silly implementation I accidentally wrote, I was able to pass all the PartialEq-related tests, even though my implementation didn't actually behave.

My implementation was like a floating point implementation, but with the data in a BigInt, but the floating point was incorrectly used in the PartialEq implementation. These tests test for that kind of mistake, where the number of digits in the decimal expansion determine the behavior of the PartialEq implementation.

Copy link
Copy Markdown
Contributor

@senekor senekor left a comment

Choose a reason for hiding this comment

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

Looks good!

nit: I would combine these two added tests and call them something like test_unequal_number_of_decimal_places, since the purpose is not to test gt or lt functionality.

@senekor
Copy link
Copy Markdown
Contributor

senekor commented Sep 10, 2023

superseded by #1726

@senekor senekor closed this Sep 10, 2023
senekor added a commit that referenced this pull request Sep 11, 2023
senekor added a commit that referenced this pull request Sep 11, 2023
senekor added a commit that referenced this pull request Sep 11, 2023
senekor added a commit that referenced this pull request Sep 11, 2023
senekor added a commit that referenced this pull request Sep 12, 2023
senekor added a commit that referenced this pull request Sep 12, 2023
senekor added a commit that referenced this pull request Sep 12, 2023
senekor added a commit that referenced this pull request Sep 13, 2023
senekor added a commit that referenced this pull request Sep 14, 2023
senekor added a commit that referenced this pull request Sep 15, 2023
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.

2 participants