You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Gary D. Gregory (Jira)" <ji...@apache.org> on 2021/07/03 18:45:00 UTC

[jira] [Updated] (CSV-148) Add test cases for withIgnoreSurroundingSpaces() and withTrim() #70

     [ https://issues.apache.org/jira/browse/CSV-148?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Gary D. Gregory updated CSV-148:
--------------------------------
    Summary: Add test cases for withIgnoreSurroundingSpaces() and withTrim() #70  (was: CSVFormat.ignoreSurroundingSpaces is ignored when printing)

> Add test cases for withIgnoreSurroundingSpaces() and withTrim() #70
> -------------------------------------------------------------------
>
>                 Key: CSV-148
>                 URL: https://issues.apache.org/jira/browse/CSV-148
>             Project: Commons CSV
>          Issue Type: Bug
>          Components: Printer
>    Affects Versions: 1.1
>         Environment: JDK 1.7
>            Reporter: Piotr Ciruk
>            Priority: Minor
>             Fix For: Review
>
>         Attachments: commons-csv_CSV-148.patch, commons-csv_CSV-148.patch
>
>          Time Spent: 50m
>  Remaining Estimate: 0h
>
> It seems that {{CSVFormat}}'s property {{ignoreSurroundingSpaces}} is not taken into consideration while printing out values using {{CSVPrinter}}.
> Given:
> {code}
> System.out.println(
> 	CSVFormat.DEFAULT
> 			.withIgnoreSurroundingSpaces(true)
> 			.format("",
> 				" ",
> 				" Single space on the left",
> 				"Single space on the right ",
> 				" Single spaces on both sides ",
> 				"   Multiple spaces on the left",
> 				"Multiple spaces on the right    ",
> 				"  Multiple spaces on both sides     ")
> );
> {code}
> Actual result:
> {code}
> ""," "," Single space on the left","Single space on the right "," Single spaces on both sides ","   Multiple spaces on the left","Multiple spaces on the right    ","  Multiple spaces on both sides     "
> {code}
> Expected result:
> {code}
> "","","Single space on the left","Single space on the right","Single spaces on both sides","Multiple spaces on the left","Multiple spaces on the right","Multiple spaces on both sides"
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)