@@ -11,26 +11,10 @@ test("Returns true for a basic proper fraction", () => {
1111 assert . equal ( isProperFraction ( 1 , 2 ) , true ) ;
1212} ) ;
1313
14- test ( "Returns true for 2/8" , ( ) => {
15- assert . equal ( isProperFraction ( 2 , 8 ) , true ) ;
16- } ) ;
17-
1814test ( "Returns true when the numerator is zero and denominator is positive" , ( ) => {
1915 assert . equal ( isProperFraction ( 0 , 1 ) , true ) ;
2016} ) ;
2117
22- test ( "Returns true for 5/8" , ( ) => {
23- assert . equal ( isProperFraction ( 5 , 8 ) , true ) ;
24- } ) ;
25-
26- test ( "Returns true for 8/9" , ( ) => {
27- assert . equal ( isProperFraction ( 8 , 9 ) , true ) ;
28- } ) ;
29-
30- test ( "Returns true for another proper fraction with a smaller numerator" , ( ) => {
31- assert . equal ( isProperFraction ( 2 , 4 ) , true ) ;
32- } ) ;
33-
3418test ( "Returns true when both numerator and denominator is negative" , ( ) => {
3519 assert . equal ( isProperFraction ( - 1 , - 2 ) , true ) ;
3620} ) ;
@@ -43,38 +27,42 @@ test("Returns true when the numerator is negative and the denominator is positiv
4327 assert . equal ( isProperFraction ( - 1 , 2 ) , true ) ;
4428} ) ;
4529
46- test ( "Returns false when the numerator is greater than the denominator" , ( ) => {
47- assert . equal ( isProperFraction ( 9 , 8 ) , false ) ;
48- } ) ;
49-
5030test ( "Returns false when numerator is negative and denominator is zero" , ( ) => {
5131 assert . equal ( isProperFraction ( - 1 , 0 ) , false ) ;
5232} ) ;
5333
54- test ( "Returns false for 4/2 " , ( ) => {
55- assert . equal ( isProperFraction ( 4 , 2 ) , false ) ;
34+ test ( "Returns false for 15/14 " , ( ) => {
35+ assert . equal ( isProperFraction ( 15 , 14 ) , false ) ;
5636} ) ;
5737
58- test ( "Returns false for 5/3 " , ( ) => {
59- assert . equal ( isProperFraction ( 5 , 3 ) , false ) ;
38+ test ( "Returns false when numerator equals denominator " , ( ) => {
39+ assert . equal ( isProperFraction ( 4 , 4 ) , false ) ;
6040} ) ;
6141
62- test ( "Returns false for 6/4 " , ( ) => {
63- assert . equal ( isProperFraction ( 6 , 4 ) , false ) ;
42+ test ( "Returns false when numerator is positive and denominator is zero " , ( ) => {
43+ assert . equal ( isProperFraction ( 1 , 0 ) , false ) ;
6444} ) ;
6545
66- test ( "Returns false for 7/1 " , ( ) => {
67- assert . equal ( isProperFraction ( 7 , 1 ) , false ) ;
46+ test ( "Returns false when both numerator and denominator are zero " , ( ) => {
47+ assert . equal ( isProperFraction ( 0 , 0 ) , false ) ;
6848} ) ;
6949
70- test ( "Returns false for 15/14 " , ( ) => {
71- assert . equal ( isProperFraction ( 15 , 14 ) , false ) ;
50+ test ( "Returns true when numerator is zero and denominator is negative " , ( ) => {
51+ assert . equal ( isProperFraction ( 0 , - 2 ) , true ) ;
7252} ) ;
7353
74- test ( "Returns false when numerator equals denominator" , ( ) => {
75- assert . equal ( isProperFraction ( 4 , 4 ) , false ) ;
54+ test ( "Returns false when positive numerator has greater magnitude than negative denominator" , ( ) => {
55+ assert . equal ( isProperFraction ( 3 , - 2 ) , false ) ;
7656} ) ;
7757
78- test ( "Returns false when numerator is positive and denominator is zero" , ( ) => {
79- assert . equal ( isProperFraction ( 1 , 0 ) , false ) ;
80- } )
58+ test ( "Returns false when negative numerator has greater magnitude than positive denominator" , ( ) => {
59+ assert . equal ( isProperFraction ( - 3 , 2 ) , false ) ;
60+ } ) ;
61+
62+ test ( "Returns false when both numbers are negative and numerator has greater magnitude" , ( ) => {
63+ assert . equal ( isProperFraction ( - 3 , - 2 ) , false ) ;
64+ } ) ;
65+
66+ test ( "Returns false when numerator and denominator are equal negative numbers" , ( ) => {
67+ assert . equal ( isProperFraction ( - 4 , - 4 ) , false ) ;
68+ } ) ;
0 commit comments