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 2016/07/31 07:29:31 UTC
commons-csv git commit: Add testRfc4180QuoteSingleChar().
Repository: commons-csv
Updated Branches:
refs/heads/master 190390bf5 -> fa437cb92
Add testRfc4180QuoteSingleChar().
Project: http://git-wip-us.apache.org/repos/asf/commons-csv/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-csv/commit/fa437cb9
Tree: http://git-wip-us.apache.org/repos/asf/commons-csv/tree/fa437cb9
Diff: http://git-wip-us.apache.org/repos/asf/commons-csv/diff/fa437cb9
Branch: refs/heads/master
Commit: fa437cb924ff6591faab05f7dc42dd5556676abd
Parents: 190390b
Author: Gary Gregory <gg...@apache.org>
Authored: Sun Jul 31 00:29:29 2016 -0700
Committer: Gary Gregory <gg...@apache.org>
Committed: Sun Jul 31 00:29:29 2016 -0700
----------------------------------------------------------------------
src/test/java/org/apache/commons/csv/CSVPrinterTest.java | 10 ++++++++++
1 file changed, 10 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/commons-csv/blob/fa437cb9/src/test/java/org/apache/commons/csv/CSVPrinterTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/csv/CSVPrinterTest.java b/src/test/java/org/apache/commons/csv/CSVPrinterTest.java
index bc7ac9b..3ee2438 100644
--- a/src/test/java/org/apache/commons/csv/CSVPrinterTest.java
+++ b/src/test/java/org/apache/commons/csv/CSVPrinterTest.java
@@ -53,6 +53,7 @@ import org.junit.Test;
*/
public class CSVPrinterTest {
+ private static final char EURO_CH = '\u20AC';
private static final char DQUOTE_CHAR = '"';
private static final char BACKSLASH_CH = '\\';
private static final char QUOTE_CH = '\'';
@@ -807,6 +808,15 @@ public class CSVPrinterTest {
}
@Test
+ public void testRfc4180QuoteSingleChar() throws IOException {
+ final StringWriter sw = new StringWriter();
+ try (final CSVPrinter printer = new CSVPrinter(sw, CSVFormat.RFC4180)) {
+ printer.printRecord(EURO_CH, "Deux");
+ assertEquals("\"" + EURO_CH + "\",Deux" + recordSeparator, sw.toString());
+ }
+ }
+
+ @Test
public void testPrinter2() throws IOException {
final StringWriter sw = new StringWriter();
try (final CSVPrinter printer = new CSVPrinter(sw, CSVFormat.DEFAULT)) {