1230fahid commented on code in PR #329:
URL: https://github.com/apache/commons-math/pull/329#discussion_r3610282972
##########
commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/util/ComplexFormatTest.java:
##########
@@ -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
+ }
Review Comment:
In this case, could we use `org.junit.jupiter.api.Assertions.assertThrows;`
and assert that an `Exception` is thrown? Specifically a `MathParseException`?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]