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

split with just Regexp (unparameterized type) splits on whitespace

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Normal
    • Resolution: Done
    • PUP 4.0.0
    • PUP 4.1.0
    • None
    • None
    • 1
    • Language 2015-04-29, Language 2015-05-13
    • 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

          People

            Unassigned Unassigned
            henrik.lindberg Henrik Lindberg
            Kurt Wall Kurt Wall
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Zendesk Support