Skip to content

Commit 338eadc

Browse files
committed
Amend Function call with negative parameters
1 parent 24bc0d7 commit 338eadc

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

Sprint-3/1-implement-and-rewrite-tests/rewrite-tests-with-jest/2-is-proper-fraction.test.js

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,20 @@ test("should return false for an improper fraction", () => {
1111
expect(isProperFraction(5, 3)).toEqual(false);
1212
});
1313

14-
// Case 3: Identify Negative Fractions:
15-
test("should return false for a negative fraction", () => {
16-
expect(isProperFraction(-2, 3)).toEqual(true);
14+
15+
// Case 3: Function call with negative parameters
16+
// Negative proper fraction: numerator absolute value less than denominator
17+
test("should return true for negative proper fraction", () => {
18+
expect(isProperFraction(-2, 3)).toEqual(true); // -2/3 is proper
19+
expect(isProperFraction(2, -3)).toEqual(true); // 2/-3 is proper
20+
expect(isProperFraction(-2, -3)).toEqual(true); // -2/-3 is proper
21+
});
22+
23+
// Negative improper fraction: numerator absolute value greater than or equal to denominator
24+
test("should return false for negative improper fraction", () => {
25+
expect(isProperFraction(-5, 3)).toEqual(false); // -5/3 is improper
26+
expect(isProperFraction(5, -3)).toEqual(false); // 5/-3 is improper
27+
expect(isProperFraction(-5, -3)).toEqual(false); // -5/-3 is improper
1728
});
1829

1930
// Case 4: Identify Equal Numerator and Denominator:

0 commit comments

Comments
 (0)