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

Triangle: Update tests to check properties, not types #424

Merged
merged 3 commits into from
Oct 26, 2016

Conversation

IanWhitney
Copy link
Contributor

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.

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],
Copy link
Contributor

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
Copy link
Contributor

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
Copy link
Contributor

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
Copy link
Contributor

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.

Copy link
Contributor

@Insti Insti 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.

@IanWhitney IanWhitney merged commit b806246 into exercism:master Oct 26, 2016
@IanWhitney IanWhitney deleted the property_based_triangles branch October 26, 2016 00:23
petertseng added a commit to petertseng/exercism-crystal that referenced this pull request Nov 1, 2019
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.
petertseng added a commit to petertseng/exercism-crystal that referenced this pull request Nov 1, 2019
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.
petertseng added a commit to petertseng/exercism-crystal that referenced this pull request Nov 1, 2019
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.
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