@@ -26,42 +26,3 @@ function assertEquals(actualOutput, targetOutput) {
2626 ) ;
2727}
2828
29- // ==========================================
30- // TEST SUITE
31- // ==========================================
32-
33- console . log ( "Running tests..." ) ;
34-
35- // 1. Standard Proper Fractions (Positive)
36- assertEquals ( isProperFraction ( 1 , 2 ) , true ) ;
37- assertEquals ( isProperFraction ( 3 , 4 ) , true ) ;
38- assertEquals ( isProperFraction ( 99 , 100 ) , true ) ;
39-
40- // 2. Standard Improper Fractions (Positive)
41- assertEquals ( isProperFraction ( 5 , 4 ) , false ) ;
42- assertEquals ( isProperFraction ( 10 , 2 ) , false ) ;
43-
44- // 3. Fraction Equals One (Improper)
45- assertEquals ( isProperFraction ( 4 , 4 ) , false ) ;
46- assertEquals ( isProperFraction ( 1 , 1 ) , false ) ;
47-
48- // 4. Numerator is Zero (Proper, since |0/d| = 0, which is < 1)
49- assertEquals ( isProperFraction ( 0 , 5 ) , true ) ;
50-
51- // 5. Handling Negative Numbers
52- // (Proper fractions must have an absolute value strictly less than 1)
53- assertEquals ( isProperFraction ( - 1 , 3 ) , true ) ; // Negative numerator
54- assertEquals ( isProperFraction ( 1 , - 3 ) , true ) ; // Negative denominator
55- assertEquals ( isProperFraction ( - 1 , - 3 ) , true ) ; // Both negative
56- assertEquals ( isProperFraction ( - 5 , 4 ) , false ) ; // Improper negative fraction
57- assertEquals ( isProperFraction ( - 4 , - 4 ) , false ) ; // Equals 1, improper
58-
59- // 6. Zero Denominator Boundary Case
60- assertEquals ( isProperFraction ( 5 , 0 ) , false ) ;
61- assertEquals ( isProperFraction ( 0 , 0 ) , false ) ;
62-
63- // 7. Decimal/Floating Point Numbers
64- assertEquals ( isProperFraction ( 1.5 , 3 ) , true ) ;
65- assertEquals ( isProperFraction ( 4.5 , 3 ) , false ) ;
66-
67- console . log ( "All tests completed!" ) ;
0 commit comments