Skip to content

Commit ba66435

Browse files
committed
added both as negative test
1 parent 1a20c17 commit ba66435

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

‎implement-and-rewrite-tests/rewrite-tests-with-jest/2-is-proper-fraction.test.js‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,13 @@ test(`should return true when: -Numerator < Denominator`, () => {
5454
expect(isProperFraction(-10, 20)).toEqual(true);
5555
});
5656

57+
// Special case: Proper fraction with both negative number: -Numerator < -Denominator
58+
test(`should return true when: -Numerator < -Denominator`, () => {
59+
expect(isProperFraction(-1, -2)).toEqual(true);
60+
expect(isProperFraction(-6, -8)).toEqual(true);
61+
expect(isProperFraction(-10, -20)).toEqual(true);
62+
});
63+
5764
// Special case: Improper fraction with negative number: Numerator > -Denominator
5865
test(`should return false when: -Numerator > Denominator`, () => {
5966
expect(isProperFraction(2, -1)).toEqual(false);

0 commit comments

Comments
 (0)