Uploaded image for project: 'Groovy'
  1. Groovy
  2. GROOVY-2613

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

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • None
    • 1.6-rc-2, 1.5.8, 1.7-beta-1
    • None
    • None

    Description

      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.

      Attachments

        Activity

          People

            paulk Paul King
            hans_d Hans Dockter
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: