Skip to content
Open
Changes from all commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,22 @@ protected char getDecimalCharacter() {
protected Locale getLocale() {
return Locale.US;
}
@Test
public void testParseBoundaryConditions() {
ComplexFormat format = ComplexFormat.getInstance();

// Test parsing empty string boundary
try {
format.parse("");
} catch (Exception ex) {
// Expected exception for empty input
}

// Test parsing garbage/invalid string boundary
try {
format.parse("invalid_complex_string");
} catch (Exception ex) {
// Expected exception for invalid input
}
Comment on lines +38 to +49

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In this case, could we use org.junit.jupiter.api.Assertions.assertThrows; and assert that an Exception is thrown? Specifically a MathParseException?

}
}