You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gg...@apache.org on 2021/01/17 03:18:37 UTC
[commons-csv] branch master updated: Use isEmpty().
This is an automated email from the ASF dual-hosted git repository.
ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-csv.git
The following commit(s) were added to refs/heads/master by this push:
new 79c3d73 Use isEmpty().
79c3d73 is described below
commit 79c3d73368a7aaade2bc2cbd8811f0e038c8c55b
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Sat Jan 16 22:18:32 2021 -0500
Use isEmpty().
---
.../java/org/apache/commons/csv/CSVParserTest.java | 24 +++++++++++-----------
1 file changed, 12 insertions(+), 12 deletions(-)
diff --git a/src/test/java/org/apache/commons/csv/CSVParserTest.java b/src/test/java/org/apache/commons/csv/CSVParserTest.java
index 14e62a3..5e4f973 100644
--- a/src/test/java/org/apache/commons/csv/CSVParserTest.java
+++ b/src/test/java/org/apache/commons/csv/CSVParserTest.java
@@ -121,7 +121,7 @@ public class CSVParserTest {
try (final CSVParser parser = CSVParser.parse(code, format)) {
final List<CSVRecord> records = parser.getRecords();
- assertTrue(records.size() > 0);
+ assertFalse(records.isEmpty());
Utils.compare("Records do not match expected result", res, records);
}
@@ -148,7 +148,7 @@ public class CSVParserTest {
try (final CSVParser parser = CSVParser.parse(code, format)) {
final List<CSVRecord> records = parser.getRecords();
- assertTrue(records.size() > 0);
+ assertFalse(records.isEmpty());
Utils.compare("", res, records);
}
@@ -168,7 +168,7 @@ public class CSVParserTest {
try (final CSVParser parser = CSVParser.parse(code, CSVFormat.DEFAULT)) {
final List<CSVRecord> records = parser.getRecords();
assertEquals(res.length, records.size());
- assertTrue(records.size() > 0);
+ assertFalse(records.isEmpty());
for (int i = 0; i < res.length; i++) {
assertArrayEquals(res[i], records.get(i).values());
}
@@ -282,7 +282,7 @@ public class CSVParserTest {
try (final CSVParser parser = CSVParser.parse(code, format)) {
final List<CSVRecord> records = parser.getRecords();
- assertTrue(records.size() > 0);
+ assertFalse(records.isEmpty());
Utils.compare("Failed to parse without comments", res, records);
@@ -330,7 +330,7 @@ public class CSVParserTest {
try (final CSVParser parser = CSVParser.parse(code, CSVFormat.DEFAULT)) {
final List<CSVRecord> records = parser.getRecords();
assertEquals(res.length, records.size());
- assertTrue(records.size() > 0);
+ assertFalse(records.isEmpty());
for (int i = 0; i < res.length; i++) {
assertArrayEquals(res[i], records.get(i).values());
}
@@ -347,7 +347,7 @@ public class CSVParserTest {
try (final CSVParser parser = CSVParser.parse(code, CSVFormat.EXCEL)) {
final List<CSVRecord> records = parser.getRecords();
assertEquals(res.length, records.size());
- assertTrue(records.size() > 0);
+ assertFalse(records.isEmpty());
for (int i = 0; i < res.length; i++) {
assertArrayEquals(res[i], records.get(i).values());
}
@@ -366,7 +366,7 @@ public class CSVParserTest {
try (final CSVParser parser = CSVParser.parse(code, CSVFormat.DEFAULT)) {
final List<CSVRecord> records = parser.getRecords();
assertEquals(res.length, records.size());
- assertTrue(records.size() > 0);
+ assertFalse(records.isEmpty());
for (int i = 0; i < res.length; i++) {
assertArrayEquals(res[i], records.get(i).values());
}
@@ -386,7 +386,7 @@ public class CSVParserTest {
try (final CSVParser parser = CSVParser.parse(code, CSVFormat.EXCEL)) {
final List<CSVRecord> records = parser.getRecords();
assertEquals(res.length, records.size());
- assertTrue(records.size() > 0);
+ assertFalse(records.isEmpty());
for (int i = 0; i < res.length; i++) {
assertArrayEquals(res[i], records.get(i).values());
}
@@ -403,7 +403,7 @@ public class CSVParserTest {
try (final CSVParser parser = CSVParser.parse(code, CSVFormat.EXCEL)) {
final List<CSVRecord> records = parser.getRecords();
assertEquals(res.length, records.size());
- assertTrue(records.size() > 0);
+ assertFalse(records.isEmpty());
for (int i = 0; i < res.length; i++) {
assertArrayEquals(res[i], records.get(i).values());
}
@@ -417,7 +417,7 @@ public class CSVParserTest {
try (final CSVParser parser = CSVParser.parse(code, CSVFormat.EXCEL)) {
final List<CSVRecord> records = parser.getRecords();
assertEquals(res.length, records.size());
- assertTrue(records.size() > 0);
+ assertFalse(records.isEmpty());
for (int i = 0; i < res.length; i++) {
assertArrayEquals(res[i], records.get(i).values());
}
@@ -620,7 +620,7 @@ public class CSVParserTest {
try (final CSVParser parser = CSVParser.parse(CSV_INPUT, CSVFormat.DEFAULT.withIgnoreSurroundingSpaces())) {
final List<CSVRecord> records = parser.getRecords();
assertEquals(RESULT.length, records.size());
- assertTrue(records.size() > 0);
+ assertFalse(records.isEmpty());
for (int i = 0; i < RESULT.length; i++) {
assertArrayEquals(RESULT[i], records.get(i).values());
}
@@ -1131,7 +1131,7 @@ public class CSVParserTest {
try (final CSVParser parser = CSVParser.parse(code, CSVFormat.EXCEL)) {
final List<CSVRecord> records = parser.getRecords();
assertEquals(res.length, records.size());
- assertTrue(records.size() > 0);
+ assertFalse(records.isEmpty());
for (int i = 0; i < res.length; i++) {
assertArrayEquals(res[i], records.get(i).values());
}