commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Morten Lynge (JIRA)" <j...@apache.org>
Subject [jira] [Comment Edited] (CSV-63) CSVPrinter always quotes empty string if it is the first on a line
Date Tue, 08 Nov 2016 08:37:58 GMT

    [ https://issues.apache.org/jira/browse/CSV-63?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15646909#comment-15646909
] 

Morten Lynge edited comment on CSV-63 at 11/8/16 8:37 AM:
----------------------------------------------------------

The issue is still in 1.4.

{code}
@Test
public void quotesOnFirstElement() throws IOException {
	StringWriter writer = new StringWriter();
	CSVPrinter printer = new CSVPrinter(writer, CSVFormat.EXCEL.withDelimiter(';'));
	printer.printRecord("", "", "");
	printer.close();
	assertEquals(";;", writer.toString()); // yields org.junit.ComparisonFailure: expected:<[];;>
but was:<[""];;>
}
{code}

{code:xml}
<dependency>
	<groupId>org.apache.commons</groupId>
	<artifactId>commons-csv</artifactId>
	<version>1.4</version>
</dependency>
{code}


was (Author: lynge):
The issue is still in 1.4.

{code}
	@Test
	public void quotesOnFirstElement() throws IOException {
		StringWriter writer = new StringWriter();
		CSVPrinter printer = new CSVPrinter(writer, CSVFormat.EXCEL.withDelimiter(';'));
		printer.printRecord("", "", "");
		printer.close();
		assertEquals(";;", writer.toString()); // yields org.junit.ComparisonFailure: expected:<[];;>
but was:<[""];;>
	}
{code}

{code:xml}
	<dependency>
		<groupId>org.apache.commons</groupId>
		<artifactId>commons-csv</artifactId>
		<version>1.4</version>
	</dependency>
{code}

> CSVPrinter always quotes empty string if it is the first on a line
> ------------------------------------------------------------------
>
>                 Key: CSV-63
>                 URL: https://issues.apache.org/jira/browse/CSV-63
>             Project: Commons CSV
>          Issue Type: Improvement
>          Components: Printer
>            Reporter: Sebb
>            Priority: Minor
>             Fix For: Patch Needed, 1.x
>
>
> CSVPrinter always quotes the empty string if it is the first on a line.
> This is inconsistent.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message