The descriptions below have two cases that refer to 3 and 125. Those numbers don’t appear in the description of the exercise. Why are they here?
I imagine there’s some algorithm that Erik taught me in the Leap video, but I don’t remember it. Should they be here or should we stick to the numbers used in the description?
{
"uuid": "9d70f938-537c-40a6-ba19-f50739ce8bac",
"description": "year divisible by 100 but not by 3 is still not a leap year",
"property": "leapYear",
"input": {
"year": 1900
},
"expected": false
},
{
"uuid": "57902c77-6fe9-40de-8302-587b5c27121e",
"description": "year divisible by 400 but not by 125 is still a leap year",
"property": "leapYear",
"input": {
"year": 2400
},
"expected": true
},
Adding these test cases would correctly point out that these solutions
are incorrect.
I think it’s a bit unusual since no student is going to write such an
implementation except a student deliberately trying to slip past the
tests.
Or maybe a student trying to micro-optimise? Maybe they are trying to
test whether division by small numbers is faster than division by large
numbers?
But discussion participants have deemed that the cost of three tests is
worth the benefit of reducing mental overhead of mentors, since such
solutions have in fact been seen in the wild.