[#78633] ruby/spec needs help from CRuby committers — Benoit Daloze <eregontp@...>
Currently, ruby/spec is maintained mostly by individuals and enjoys the
13 messages
2016/12/13
[#78963] Re: ruby/spec needs help from CRuby committers
— Urabe Shyouhei <shyouhei@...>
2017/01/04
I did ask attendees of last developer meeting to join this
[#78642] Re: ruby/spec needs help from CRuby committers
— Eric Wong <normalperson@...>
2016/12/14
Benoit Daloze <eregontp@gmail.com> wrote:
[ruby-core:78894] [Ruby trunk Feature#13083] {String|Symbol}#match{?} with nil returns falsy as Regexp#match{?}
From:
nobu@...
Date:
2016-12-29 00:15:04 UTC
List:
ruby-core #78894
Issue #13083 has been updated by Nobuyoshi Nakada.
Description updated
----------------------------------------
Feature #13083: {String|Symbol}#match{?} with nil returns falsy as Regexp#match{?}
https://bugs.ruby-lang.org/issues/13083#change-62307
* Author: Kenichi Kamiya
* Status: Open
* Priority: Normal
* Assignee:
* Target version:
----------------------------------------
Just for consistency
* patch: https://github.com/ruby/ruby/pull/1506
* spec: https://github.com/ruby/spec/pull/380
Currently behaves as ( ruby --version: ruby 2.5.0dev (2016-12-28 trunk 57228) [x86_64-darwin16] )
~~~ ruby
'string'.__send__(:=~, nil) #=> nil
'string'.match(nil) #=> TypeError: wrong argument type nil (expected Regexp)
'string'.match?(nil) #=> TypeError: wrong argument type nil (expected Regexp)
:symbol.__send__(:=~, nil) #=> nil
:symbol.match(nil) #=> TypeError: wrong argument type nil (expected Regexp)
:symbol.match?(nil) #=> TypeError: wrong argument type nil (expected Regexp)
/regex/.__send__(:=~, nil) #=> nil
/regex/.match(nil) #=> nil
/regex/.match?(nil) #=> false
~~~
Expected to
~~~ruby
'string'.__send__(:=~, nil) #=> nil
'string'.match(nil) #=> nil
'string'.match?(nil) #=> false
:symbol.__send__(:=~, nil) #=> nil
:symbol.match(nil) #=> nil
:symbol.match?(nil) #=> false
/regex/.__send__(:=~, nil) #=> nil
/regex/.match(nil) #=> nil
/regex/.match?(nil) #=> false
~~~
--
https://bugs.ruby-lang.org/
Unsubscribe: <mailto:ruby-core-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>