Skip to content

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

Merged
IanWhitney merged 3 commits intoexercism:masterfrom
IanWhitney:property_based_triangles
Oct 26, 2016
Merged

Triangle: Update tests to check properties, not types#424
IanWhitney merged 3 commits intoexercism:masterfrom
IanWhitney:property_based_triangles

Conversation

@IanWhitney
Copy link
Copy Markdown
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.
Comment thread exercises/triangle/canonical-data.json Outdated
"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
Copy Markdown
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
Copy Markdown
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

Comment thread exercises/triangle/canonical-data.json Outdated
"expected": "illegal"
"description": "false if two sides are equal",
"sides": [4, 4, 3],
"expected": true
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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