rails/activesupport/test/core_ext
Hartley McGuire 64184c6f50
Fix Range#overlap? ignoring empty ranges
Previously, #overlap? would incorrectly return true when one of the
ranges is effectively "empty":

```ruby
(2...2).overlap? 1..2 # => true
(1..2).overlap? 2...2 # => true
```

This is fixed in the Ruby 3.3 implementation of Range#overlap?, so this
commit fixes it for Ruby < 3.3 as well.

The tests added are from the Ruby repository and the implementation is
effectively a Ruby version of the fix in C.

Co-authored-by: Nobuyoshi Nakada <nobu@ruby-lang.org>
Co-authored-by: Shouichi Kamiya <shouichi.kamiya@gmail.com>
2023-09-22 19:48:49 -04:00
..
array Remove deprecated option to passing a format to #to_s 2023-03-03 00:38:30 +00:00
class Class attribute writer is a public method 2020-10-02 15:53:46 +09:00
digest Remove deprecated support to generate incorrect RFC 4122 UUIDs 2023-03-03 00:38:36 +00:00
hash Remove deprecated file active_support/core_ext/hash/transform_values 2020-10-30 00:25:58 +00:00
kernel allow running each test with pure ruby path/to/test.rb 2019-12-18 08:49:19 -06:00
module Merge pull request #45918 from jonathanhefner/thread_mattr_accessor-default-require-frozen 2022-09-01 16:03:18 -05:00
object Use native assert_raises instead of custom assert_raises_with_message. 2023-06-06 20:10:23 +00:00
pathname Pathname.blank? only returns true for Pathname.new("") 2022-02-19 09:54:58 +01:00
bigdecimal_test.rb allow running each test with pure ruby path/to/test.rb 2019-12-18 08:49:19 -06:00
class_test.rb Filter reloaded classes in Class#subclasses and Class#descendants core exts 2022-09-28 12:08:58 +02:00
date_and_time_behavior.rb Add quarter method to date/time (#45009) 2022-07-14 16:43:52 -07:00
date_and_time_compatibility_test.rb Add missing assert_not_deprecated deprecator args 2022-11-09 12:07:29 -06:00
date_ext_test.rb Remove deprecated option to passing a format to #to_s 2023-03-03 00:38:30 +00:00
date_time_ext_test.rb Remove deprecated option to passing a format to #to_s 2023-03-03 00:38:30 +00:00
duration_test.rb Drop Rubinius code 2022-09-15 23:43:51 +09:00
enumerable_test.rb Fix defect in Enumerable#many introduced in rails/rails@d862dff 2023-06-06 17:41:44 -04:00
erb_util_test.rb rubocop 2022-10-09 15:54:42 -07:00
file_test.rb atomic write race condition 2022-01-16 16:54:58 -08:00
hash_ext_test.rb Remove deprecated override of ActiveSupport::TimeWithZone.name 2023-03-03 00:38:31 +00:00
integer_ext_test.rb allow running each test with pure ruby path/to/test.rb 2019-12-18 08:49:19 -06:00
kernel_test.rb [Active Support] Add explicit assertions to tests with no assertions 2022-02-15 23:44:25 +00:00
load_error_test.rb allow running each test with pure ruby path/to/test.rb 2019-12-18 08:49:19 -06:00
module_test.rb Fix delegation to a method with implicit block. 2023-04-10 19:28:26 +02:00
name_error_test.rb Remove all version checking for older Rubies in tests 2021-02-05 13:21:45 +09:00
numeric_ext_test.rb Use a consistent format when testing BigDecimal.to_s 2023-07-09 17:22:21 +09:00
range_ext_test.rb Fix Range#overlap? ignoring empty ranges 2023-09-22 19:48:49 -04:00
regexp_ext_test.rb allow running each test with pure ruby path/to/test.rb 2019-12-18 08:49:19 -06:00
secure_random_test.rb Use SecureRandom.alphanumeric for SecureRandom.base36 2023-08-30 11:28:42 +02:00
string_ext_test.rb Implement SafeBuffer#bytesplice 2023-03-13 12:13:31 -07:00
symbol_ext_test.rb Removes Symbol#start_with? and Symbol#end_with? since they are defined in Ruby 2.7 2021-02-07 21:47:25 -03:00
time_ext_test.rb Remove deprecated option to passing a format to #to_s 2023-03-03 00:38:30 +00:00
time_with_zone_test.rb Enable Minitest/LiteralAsActualArgument 2023-09-13 10:09:32 +09:00