sahvx655-wq commented on code in PR #399:
URL: https://github.com/apache/commons-validator/pull/399#discussion_r3426280168


##########
src/test/java/org/apache/commons/validator/routines/ISINValidatorTest.java:
##########
@@ -110,4 +111,16 @@ void testIsValidTrue() {
         }
     }
 
+    @Test
+    void testValidWithSurroundingWhitespaceCountryCode() {
+        // The underlying CodeValidator trims the input, so the country code 
must be
+        // derived from the trimmed code. Otherwise a valid ISIN with 
surrounding whitespace
+        // is accepted without the country check but rejected with it.
+        for (final String code : new String[] { " US0378331005", "US0378331005 
", " US0378331005 " }) {

Review Comment:
   Done. Swapped the loop for a @ParameterizedTest with @ValueSource covering 
the leading, trailing and surrounding whitespace cases. Each case now runs as 
its own invocation, so a failure points straight at the offending input rather 
than aborting the whole loop. Full ISINValidatorTest is green (7 tests, 0 
failures).



-- 
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]

Reply via email to