-
-
Notifications
You must be signed in to change notification settings - Fork 547
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
Triangle: Update tests to check properties, not types #424
Triangle: Update tests to check properties, not types #424
Conversation
As discussed here: exercism#379 Converts the tests so that they are checking the property of a triangle and not its type (or type stand-in like symbol/atom/etc.). I've removed some duplicative tests, but I believe I've still covered all the edge cases that were part of the old test suite.
"expected": "isosceles" | ||
"#": "Your track may choose to skip this test and deal only with integers if appropriate", | ||
"description": "sides may be floats", | ||
"sides": [0.5, 0.4, 0.6], |
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.
This doesn't look equilateral.
"#": "Your track may choose to skip this test and deal only with integers if appropriate", | ||
"description": "sides may be floats", | ||
"sides": [0.5, 0.4, 0.6], | ||
"expected": true |
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.
This doesn't look isosceles
"expected": "illegal" | ||
"description": "false if two sides are equal", | ||
"sides": [4, 4, 3], | ||
"expected": true |
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.
true != false
"expected": "scalene" | ||
"description": "true if three sides are equal", | ||
"sides": [4, 4, 4], | ||
"expected": true |
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.
Might be good to add a comment or expansion of the description here that clarifies that this is BOTH isosceles and equilateral.
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 good.
These have always been present, ever since exercism/problem-specifications#424. If the Crystal track wishes its generator to produce the test suite, without need for post-hoc modification of the generated output, then it seems the two choices are: 1. Include the cases 2. Add code that detects float inputs and does not output those cases. This commit implements the former plan.
These have always been present, ever since exercism/problem-specifications#424. If the Crystal track wishes its generator to produce the test suite, without need for post-hoc modification of the generated output, then it seems the two choices are: 1. Include the cases 2. Add code that detects float inputs and does not output those cases. This commit implements the former plan.
These have always been present, ever since exercism/problem-specifications#424. If the Crystal track wishes its generator to produce the test suite, without need for post-hoc modification of the generated output, then it seems the two choices are: 1. Include the cases 2. Add code that detects float inputs and does not output those cases. This commit implements the former plan.
As discussed here: #379
Converts the tests so that they are checking the property of a triangle
and not its type (or type stand-in like symbol/atom/etc.).
I've removed some duplicative tests, but I believe I've still covered
all the edge cases that were part of the old test suite.