Uploaded image for project: 'Puppet'
  1. Puppet
  2. PUP-4463

split with just Regexp (unparameterized type) splits on whitespace

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Normal
    • Resolution: Done
    • Affects Version/s: PUP 4.0.0
    • Fix Version/s: PUP 4.1.0
    • Component/s: None
    • Labels:
      None
    • Template:
    • Epic Link:
    • Story Points:
      1
    • Sprint:
      Language 2015-04-29, Language 2015-05-13
    • Release Notes:
      Bug Fix

      Description

      Since 4.0.0 it is possible to give a Regexp type to split to specify the pattern to split on. Since a Regexp without a parameter (pattern) has an undef/nil pattern, and this is given directly to the Ruby String#split method, it is taken to mean "split on whitespace".

      This is different that if the pattern is set to the an empty string, or to an empty regular expression where the split is made on "nothing" - i.e. between every character.

      The most reasonable would be if Regexp and Regexp[''] results in the same regular expression while as types they are different since Regexp accepts any other Regexp, while Regexp[''] only accepts that specific regexp.

      QA Risk Analysis

      Probability Medium (how frequently do people split with Regexp?)
      Impact Low (unexpected results but no data loss)
      Risk Level Medium
      Test Level Spec

        Attachments

          Activity

            jsd-sla-details-panel

              People

              • Assignee:
                Unassigned
                Reporter:
                henrik.lindberg Henrik Lindberg
                QA Contact:
                Kurt Wall
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: