groovy (moved to ASF)
  1. groovy (moved to ASF)
  2. GROOVY-2613

add 'transform to platform newline' function to the GDK String API


    • Type: Improvement Improvement
    • Status: Closed Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.6-rc-2, 1.5.8, 1.7-beta-1
    • Component/s: None
    • Labels:
    • Number of attachments :


      Triple quoted strings are very useful in unit tests. But there is a problem when you create the expected value with triple quoted strings and the actual value is for example produced by a writer. On windows the two values are not equal, as triple quoted strings use always '\' as the line separator. I don't know the reason why triple quoted strings behave like. But it would be nice to have a straight forward way to turn a triple quoted String into its platform specific form. The PlatformLineWriter is offering such a functionality, but it is obviously not that straightforward to use it. Therefore I propose to have a new method for the GDK String API that does what PlatformLineWriter does: gobbles any \r characters and replaces every \n with a platform specific newline.


        No work has yet been logged on this issue.


          • Assignee:
            Paul King
            Hans Dockter


            • Created: