diff --git a/core/range/cover_spec.rb b/core/range/cover_spec.rb index fa881607e9..a291458bf2 100644 --- a/core/range/cover_spec.rb +++ b/core/range/cover_spec.rb @@ -7,4 +7,8 @@ it_behaves_like :range_cover_and_include, :cover? it_behaves_like :range_cover, :cover? it_behaves_like :range_cover_subrange, :cover? + + it "does lax unicode match" do + ("\u{999}".."\u{9999}").cover?("\u{9995}").should be_true + end end diff --git a/core/range/include_spec.rb b/core/range/include_spec.rb index b2c7a54545..c33f810c14 100644 --- a/core/range/include_spec.rb +++ b/core/range/include_spec.rb @@ -7,4 +7,8 @@ describe "Range#include?" do it_behaves_like :range_cover_and_include, :include? it_behaves_like :range_include, :include? + + it "does strict unicode match" do + ("\u{999}".."\u{9999}").include?("\u{9995}").should be_false + end end diff --git a/core/range/shared/cover_and_include.rb b/core/range/shared/cover_and_include.rb index 7028afaa89..f36a2cef8b 100644 --- a/core/range/shared/cover_and_include.rb +++ b/core/range/shared/cover_and_include.rb @@ -57,7 +57,6 @@ it "returns true if argument is less than the last value of the range and greater than the first value" do (20..30).send(@method, 28).should be_true ('e'..'h').send(@method, 'g').should be_true - ("\u{999}".."\u{9999}").send @method, "\u{9995}" end it "returns true if argument is sole element in the range" do