exercism / problem-specifications

Shared metadata for exercism exercises.
MIT License
327 stars 543 forks source link

Triangle: a gap in the tests. #1567

Open YuriyCherniy opened 5 years ago

YuriyCherniy commented 5 years ago

I've wrote a function on the Python track for the triangle exercise that can cheat current tests. It was described in exercism/python#1894 and merged on the Python track. I was recommended by @cmccandless to create an issue in this repo to solve this problem for others track in the futere.

cmccandless commented 5 years ago

Description edited to take advantage of GitHub quick linking syntax

cmccandless commented 5 years ago

From exercism/python#1894

Adding a new test for scalene(sides) function and renaming another test to match the new test. Current tests for scalene(sides) function can be hacked by this code:

def scalene(sides):
    sides.sort()
    if sum(sides[:2]) < sides[2] or sides[1] == sides[2]:
        return False
    return True

while the new test not.

Proposed new test case

{
  "description": "two sides are equal and third side is larger",
  "property": "scalene",
  "input": {
    "sides": [3, 3, 4]
  },
  "expected": false
}
kytrinyx commented 5 years ago

Thanks so much @YuriyCherniy !

This repo is currently on "lock-down" while we think through a few things. As such, I'm going to put this issue on hold for now, and we will come back to once we've worked through the issues with this repo that we need to address. You can read more here.