Skip to content

Commit 52fef2a

Browse files
committed
Add more negative-value test cases for isProperFraction
1 parent 3449903 commit 52fef2a

2 files changed

Lines changed: 6 additions & 0 deletions

File tree

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ test("Handles zero and negative values", () => {
1919
assert.equal(isProperFraction(-1, 2), true);
2020
assert.equal(isProperFraction(1, -2), true);
2121
assert.equal(isProperFraction(-3, -2), false);
22+
assert.equal(isProperFraction(-1, -2), true);
23+
assert.equal(isProperFraction(-3, 2), false);
24+
assert.equal(isProperFraction(3, -2), false);
2225
});
2326

2427
test("Rejects a zero denominator", () => {

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ test.each([
1010
[-1, 2, true],
1111
[1, -2, true],
1212
[-3, -2, false],
13+
[-1, -2, true],
14+
[-3, 2, false],
15+
[3, -2, false],
1316
[0, 0, false],
1417
[1, 0, false],
1518
])("checks %i/%i", (numerator, denominator, expected) => {

0 commit comments

Comments
 (0)