Skip to content
  • nagachika's avatar
    477ab3f6
    merge revision(s) c5475f42: [Backport #18748] · 477ab3f6
    nagachika authored
    	Fix Range#cover? returning true for beginless ranges of different
    	 types
    
    	Previously `(2..).cover?("2"..)` was false, but
    	`(..2).cover?(.."2")` was true.  This changes it so both are false,
    	treating beginless ranges the same as endless ranges in regards to
    	type checks.
    
    	This also adds documentation to #cover? to describe behavior with
    	beginless and endless ranges, testing each documentation example,
    	which is how this bug was found.
    
    	Fixes [Bug #18155]
    	---
    	 range.c                 | 54 ++++++++++++++++++++++++++++++++++++++++++++++++-
    	 test/ruby/test_range.rb | 29 ++++++++++++++++++++++++++
    	 2 files changed, 82 insertions(+), 1 deletion(-)
    477ab3f6
    merge revision(s) c5475f42: [Backport #18748]
    nagachika authored
    	Fix Range#cover? returning true for beginless ranges of different
    	 types
    
    	Previously `(2..).cover?("2"..)` was false, but
    	`(..2).cover?(.."2")` was true.  This changes it so both are false,
    	treating beginless ranges the same as endless ranges in regards to
    	type checks.
    
    	This also adds documentation to #cover? to describe behavior with
    	beginless and endless ranges, testing each documentation example,
    	which is how this bug was found.
    
    	Fixes [Bug #18155]
    	---
    	 range.c                 | 54 ++++++++++++++++++++++++++++++++++++++++++++++++-
    	 test/ruby/test_range.rb | 29 ++++++++++++++++++++++++++
    	 2 files changed, 82 insertions(+), 1 deletion(-)
Loading