Uploaded image for project: 'Commons CSV'
  1. Commons CSV
  2. CSV-148

Add test cases for withIgnoreSurroundingSpaces() and withTrim() #70

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 1.1
    • 1.9.0
    • Printer
    • None
    • JDK 1.7

    Description

      It seems that CSVFormat's property ignoreSurroundingSpaces is not taken into consideration while printing out values using CSVPrinter.

      Given:

      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     ")
      );
      

      Actual result:

      ""," "," 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     "
      

      Expected result:

      "","","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"
      

      Attachments

        1. commons-csv_CSV-148.patch
          2 kB
          Niels Bischof
        2. commons-csv_CSV-148.patch
          0.6 kB
          Pratiyush

        Issue Links

          Activity

            People

              Unassigned Unassigned
              cpio Piotr Ciruk
              Votes:
              1 Vote for this issue
              Watchers:
              8 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 50m
                  50m