Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-54657

dropWhile doesn't behave correctly

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • pipeline
    • None

      The following pipeline outputs 1 2 3 true, the expected output is 1 2 3 [2,3],  

      pipeline {
          stages {
              stage('Testing groovy closures') {
                  steps {
                      script {
                          [1, 2, 3].each { println(it) }
                          def a = [1, 2, 3].dropWhile { it != 2 }
                          println(a)
                      }
                  }
              }
          }
      } 

      Running Pipeline Groovy Plugin 2.60

            Unassigned Unassigned
            jgogstad Jostein Gogstad
            Votes:
            2 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: