[#73707] [Ruby trunk Misc#12004] Code of Conduct — hanmac@...
Issue #12004 has been updated by Hans Mackowiak.
3 messages
2016/02/05
[#73730] [Ruby trunk Feature#12034] RegExp does not respect file encoding directive — nobu@...
Issue #12034 has been updated by Nobuyoshi Nakada.
3 messages
2016/02/07
[#73746] [Ruby trunk Feature#12034] RegExp does not respect file encoding directive — nobu@...
Issue #12034 has been updated by Nobuyoshi Nakada.
3 messages
2016/02/09
[#73919] [Ruby trunk Feature#11262] Make more objects behave like "Functions" — Ruby-Lang@...
Issue #11262 has been updated by J旦rg W Mittag.
3 messages
2016/02/22
[#74019] [Ruby trunk Bug#12103][Rejected] ruby process hangs while executing regular expression. — duerst@...
Issue #12103 has been updated by Martin D端rst.
3 messages
2016/02/27
[ruby-core:73894] [Ruby trunk Bug#12090] `Range#cover` does not raise an exception when comparison fails
From:
sawadatsuyoshi@...
Date:
2016-02-19 15:37:33 UTC
List:
ruby-core #73894
Issue #12090 has been reported by Tsuyoshi Sawada.
----------------------------------------
Bug #12090: `Range#cover` does not raise an exception when comparison fails
https://bugs.ruby-lang.org/issues/12090
* Author: Tsuyoshi Sawada
* Status: Open
* Priority: Normal
* Assignee:
* ruby -v:
* Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: UNKNOWN, 2.3: UNKNOWN
----------------------------------------
The documentation for `Range#cover?` says,
~~~
cover?(obj) → true or false
Returns true if obj is between the begin and end of the range.
This tests begin <= obj <= end when exclude_end? is false and begin <= obj < end when exclude_end? is true.
~~~
which implies that, when comparison fails, `cover?` should raise an error. But actually, it doesn't:
~~~RUBY
"a" <= 1 # => ArgumentError: comparison of String with 1 failed
1 <= "a" # => ArgumentError: comparison of Fixnum with String failed
("a".."z").cover?(1) # => false
~~~
It silently returns `false` instead of raising an error.
Either `Range#cover?` should raise an error when comparison fails, or the documentation should be changed to correctly describe this behaviour.
--
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>