This is an automated email from the ASF dual-hosted git repository.
sebb pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-validator.git
The following commit(s) were added to refs/heads/master by this push:
new c148b04 Show individual failures
c148b04 is described below
commit c148b04d1819599c2e8cd9da69f7f37a337b74dc
Author: Sebb <[email protected]>
AuthorDate: Mon Jul 27 13:20:15 2020 +0100
Show individual failures
Test currently disabled, but it would be useful to show all errors
---
.../apache/commons/validator/routines/EmailValidatorTest.java | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git
a/src/test/java/org/apache/commons/validator/routines/EmailValidatorTest.java
b/src/test/java/org/apache/commons/validator/routines/EmailValidatorTest.java
index 0df9202..620d192 100644
---
a/src/test/java/org/apache/commons/validator/routines/EmailValidatorTest.java
+++
b/src/test/java/org/apache/commons/validator/routines/EmailValidatorTest.java
@@ -477,14 +477,17 @@ protected void tearDown() {
* The real solution is to fix the email parsing.
*/
public void _testEmailFromPerl() {
+ int errors = 0;
for (int index = 0; index < testEmailFromPerl.length; index++) {
String item = testEmailFromPerl[index].item;
- if (testEmailFromPerl[index].valid) {
- assertTrue("Should be OK: "+item, validator.isValid(item));
- } else {
- assertFalse("Should fail: "+item, validator.isValid(item));
+ boolean exp = testEmailFromPerl[index].valid;
+ boolean act = validator.isValid(item);
+ if (act != exp) {
+ System.out.printf("%s: expected %s actual %s%n", item, exp,
act);
+ errors += 1;
}
}
+ assertEquals("Expected 0 errors", 0, errors);
}
public void testValidator293(){