Skip to content

Commit 5ab881f

Browse files
committed
Use mathematical notation |n| in isProperFraction test descriptions
1 parent 3c1c70d commit 5ab881f

1 file changed

Lines changed: 8 additions & 7 deletions

File tree

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,25 @@
1-
// This statement loads the isProperFraction function you wrote in the implement directory.
21
const isProperFraction = require("../implement/2-is-proper-fraction");
32

3+
test(`should return false when denominator is zero`, () => {
4+
expect(isProperFraction(1, 0)).toEqual(false);
5+
});
6+
47
test(`should return true when |numerator| < |denominator|`, () => {
58
expect(isProperFraction(1, 2)).toEqual(true);
6-
expect(isProperFraction(-1, 2)).toEqual(true);
7-
expect(isProperFraction(1, -2)).toEqual(true);
8-
expect(isProperFraction(-1, -2)).toEqual(true);
9+
expect(isProperFraction(3, 7)).toEqual(true);
910
});
1011

1112
test(`should return false when |numerator| >= |denominator|`, () => {
1213
expect(isProperFraction(2, 1)).toEqual(false);
1314
expect(isProperFraction(3, 3)).toEqual(false);
1415
});
1516

16-
test(`should handle negative numerator: return abs(n) < abs(d)`, () => {
17+
test(`should return true when numerator is negative and |numerator| < |denominator|`, () => {
1718
expect(isProperFraction(-1, 2)).toEqual(true);
1819
expect(isProperFraction(-3, 2)).toEqual(false);
1920
});
2021

21-
test(`should handle negative denominator: return abs(n) < abs(d)`, () => {
22+
test(`should return true when denominator is negative and |numerator| < |denominator|`, () => {
2223
expect(isProperFraction(1, -2)).toEqual(true);
2324
expect(isProperFraction(3, -2)).toEqual(false);
24-
});
25+
});

0 commit comments

Comments
 (0)