You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Calculator.divide throws ArithmeticException instead of a clear IllegalArgumentException for a zero divisor #1
Calculator.divide throws an unchecked ArithmeticException when the divisor is 0.
Expected behaviour: divide should validate its input and throw IllegalArgumentException with the message divisor must not be zero before performing the division.
The failing test is CalculatorTest#should_reject_division_by_zero_with_a_clear_message in src/test/java/demo/CalculatorTest.java. The method to change is in src/main/java/demo/Calculator.java. Please keep the other arithmetic methods unchanged.
Activity
Merge pull request #2 from bingqin2/patchpilot/7618be68-7593-4f1b-9e0…