-
-
Notifications
You must be signed in to change notification settings - Fork 559
Closed
Description
The tests are missing a really cool scenario, that is, numbers less than one and any decimal number actually.
With the existing error cases (0 and -15), a raise if n < 1 does the trick and students wouldn't even think of an is_integer check, but we know the Collatz Conjecture wouldn't like that.
From a mentoring discussion with @kotp :
The tests that exist are not enforcing that we use only valid numbers, it only touches on zero and negative numbers, but it is not inclusive of the numbers that are not valid.
So how about something like this?
{
"description": "positive value but less than one is an error",
"comments": ["Collatz Conjecture holds only for positive integers"],
"property": "steps",
"input": {
"number": 0.5
},
"expected": {
"error": "Only positive integers are allowed"
}
}
Metadata
Metadata
Assignees
Labels
No labels