This is an automated email from the ASF dual-hosted git repository.
garydgregory 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 a1cf4f2a Refactor delimiter in test
a1cf4f2a is described below
commit a1cf4f2a73065281ca7c22841c2f3ec0c00098c1
Author: Gary Gregory <[email protected]>
AuthorDate: Fri Jun 19 11:44:21 2026 +0000
Refactor delimiter in test
Rename local variable
---
src/test/java/org/apache/commons/csv/CSVParserTest.java | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/test/java/org/apache/commons/csv/CSVParserTest.java
b/src/test/java/org/apache/commons/csv/CSVParserTest.java
index 29ca0cf1..aa4a639d 100644
--- a/src/test/java/org/apache/commons/csv/CSVParserTest.java
+++ b/src/test/java/org/apache/commons/csv/CSVParserTest.java
@@ -672,10 +672,10 @@ class CSVParserTest {
@Test
void
testGetBytePositionMultiCharacterDelimiterWithSupplementaryCharacter() throws
IOException {
final String delimiter = "x😀";
- final String code = "ax😀b\ncx😀d\n";
+ final String data = "a" + delimiter + "b\nc" + delimiter + "d\n";
final CSVFormat format =
CSVFormat.DEFAULT.builder().setDelimiter(delimiter).get();
try (CSVParser parser = CSVParser.builder()
- .setReader(new StringReader(code))
+ .setReader(new StringReader(data))
.setFormat(format)
.setCharset(UTF_8)
.setTrackBytes(true)
@@ -687,7 +687,7 @@ class CSVParserTest {
assertValuesEquals(new String[] { "a", "b" }, first);
assertValuesEquals(new String[] { "c", "d" }, second);
assertEquals(0, first.getBytePosition());
- assertEquals("ax😀b\n".getBytes(UTF_8).length,
second.getBytePosition());
+ assertEquals("a" + delimiter + "b\n".getBytes(UTF_8).length,
second.getBytePosition());
}
}