Repository navigation
Conversation
This comment has been minimized.
This comment has been minimized.
cjyuan
left a comment
There was a problem hiding this comment.
Code looks good.
It seems you might have misunderstood the definition of proper fraction.
| test(`should return "Invalid angle" when (angle === Invalid)`, () => { | ||
| // Test various invalid angles, including boundary cases | ||
| expect(getAngleType(361)).toEqual("Invalid angle"); | ||
| expect(getAngleType(0)).toEqual("Invalid angle"); | ||
| expect(getAngleType(-181)).toEqual("Invalid angle"); | ||
| }); |
There was a problem hiding this comment.
-
"(angle === Invalid)" does not quite tell which angles are considered invalid.
-
0is a good boundary case to check. Could you think of the other boundary case?
| // Special case: numerator is negative number | ||
| test(`should return true when denominator is 1`, () => { | ||
| expect(isProperFraction(-1, 1)).toEqual(false); | ||
| }); |
There was a problem hiding this comment.
-1 / 1, which is equal to -1, is not a proper fraction.
Could you look up the definition of "proper fraction" and then update the tests and your function implementation?
…eworked negative case in the proper fraction file
|
May I ask which authoritative source you used for the definition of a proper fraction? Are |
Task code
CYF-1059
Changelist
21/10 - updated invalid range and description in the get and angle file and reworked negative case in the proper fraction file
Uploaded implement and rewrite tests coursework