Skip to content

Commit bc2d6b9

Browse files
committed
testing: redundant cases
1 parent ef82cad commit bc2d6b9

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

src/test/java/com/thealgorithms/stacks/PostfixEvaluatorTest.java

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -33,18 +33,12 @@ void testExtraOperands() {
3333
@Test
3434
@DisplayName("Should throw ArithmeticException for division by zero")
3535
void testDivisionByZero() {
36-
assertThrows(ArithmeticException.class, () -> PostfixEvaluator.evaluatePostfix("5 0 /"));
36+
assertThrows(ArithmeticException.class, () -> PostfixEvaluator.evaluatePostfix("1 0 /"));
3737
}
3838

3939
@Test
4040
@DisplayName("Should throw IllegalArgumentException for invalid characters")
4141
void testInvalidToken() {
42-
assertThrows(IllegalArgumentException.class, () -> PostfixEvaluator.evaluatePostfix("5 a +"));
43-
}
44-
45-
@Test
46-
@DisplayName("Should throw EmptyStackException for empty input")
47-
void testEmptyInput() {
48-
assertThrows(EmptyStackException.class, () -> PostfixEvaluator.evaluatePostfix(""));
42+
assertThrows(IllegalArgumentException.class, () -> PostfixEvaluator.evaluatePostfix("1 a +"));
4943
}
5044
}

0 commit comments

Comments
 (0)