Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
testing: redundant cases
  • Loading branch information
alxkm committed Jul 17, 2025
commit bc2d6b95b3ba8211c441b690c6e7d6dffcbb79d0
Original file line number Diff line number Diff line change
Expand Up @@ -33,18 +33,12 @@ void testExtraOperands() {
@Test
@DisplayName("Should throw ArithmeticException for division by zero")
void testDivisionByZero() {
assertThrows(ArithmeticException.class, () -> PostfixEvaluator.evaluatePostfix("5 0 /"));
assertThrows(ArithmeticException.class, () -> PostfixEvaluator.evaluatePostfix("1 0 /"));
}

@Test
@DisplayName("Should throw IllegalArgumentException for invalid characters")
void testInvalidToken() {
assertThrows(IllegalArgumentException.class, () -> PostfixEvaluator.evaluatePostfix("5 a +"));
}

@Test
@DisplayName("Should throw EmptyStackException for empty input")
void testEmptyInput() {
assertThrows(EmptyStackException.class, () -> PostfixEvaluator.evaluatePostfix(""));
assertThrows(IllegalArgumentException.class, () -> PostfixEvaluator.evaluatePostfix("1 a +"));
}
}
Loading