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

Improve Groovy Truth for CharSequence and arrays

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.0
    • 1.1-beta-1
    • None
    • None

    Description

      Currently we have

      • an empty (G)String evaluates to false
        BUT an other empty CharSequence like StringBuffer evaluates to true

      assert !""
      assert new StringBuffer()

      • an empty list evaluates to false
        BUT an empty array evaluates to true

      assert ![]
      assert [].toArray()

      It would be cleaner when:

      • empty CharSequence evaluates to false
      • empty array evaluates to false

      Attachments

        Activity

          People

            mguillem mguillem
            mguillemot@yahoo.fr Marc Guillemot
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: