Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion core/src/main/java/org/jruby/RubyString.java
Original file line number Diff line number Diff line change
Expand Up @@ -7191,7 +7191,7 @@ public static IRubyObject includeRange(ThreadContext context, RubyString _beg, R
(e = eByteList.get(0)) < 128 &&
(v = vByteList.get(0)) < 128) {
if (b <= v && v < e) return context.tru;
if (!exclusive && v == e) return context.tru;
if (!exclusive && b <= v && v == e) return context.tru;
return context.fals;
}
}
Expand Down
5 changes: 5 additions & 0 deletions test/mri/ruby/test_range.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1034,6 +1034,11 @@ def test_include
assert_include("a"..."z", "y")
assert_not_include("a"..."z", "z")
assert_not_include("a".."z", "cc")
assert_not_include("z".."a", "a")
assert_not_include("z".."a", "z")
assert_not_include("z".."a", "m")
assert_include("a".."a", "a")
assert_not_include("a"..."a", "a")
assert_raise(TypeError) {("a"..).include?("c")}
assert_raise(TypeError) {("a"..).include?("5")}

Expand Down
Loading