summaryrefslogtreecommitdiff
path: root/spec/ruby/core/string/downcase_spec.rb
diff options
context:
space:
mode:
authorBenoit Daloze <eregontp@gmail.com>2020-01-28 20:47:48 +0100
committerBenoit Daloze <eregontp@gmail.com>2020-01-28 20:47:48 +0100
commit809f0b8a1357f14f9645210d4812f4400c8d397e (patch)
tree7ce6192f94b1dc4b004798aa5d0c4d6bac02577f /spec/ruby/core/string/downcase_spec.rb
parented377cc9aaf1ccbede19ddc6c464f5fbf3cabc34 (diff)
Update to ruby/spec@f8a2d54
Diffstat (limited to 'spec/ruby/core/string/downcase_spec.rb')
-rw-r--r--spec/ruby/core/string/downcase_spec.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/spec/ruby/core/string/downcase_spec.rb b/spec/ruby/core/string/downcase_spec.rb
index 84e94ee104..a78b6de373 100644
--- a/spec/ruby/core/string/downcase_spec.rb
+++ b/spec/ruby/core/string/downcase_spec.rb
@@ -88,6 +88,12 @@ describe "String#downcase!" do
a.should == "hello"
end
+ it "modifies self in place for non-ascii-compatible encodings" do
+ a = "HeLlO".encode("utf-16le")
+ a.downcase!
+ a.should == "hello".encode("utf-16le")
+ end
+
describe "full Unicode case mapping" do
it "modifies self in place for all of Unicode with no option" do
a = "ÄÖÜ"
@@ -112,6 +118,12 @@ describe "String#downcase!" do
a.downcase!(:ascii)
a.should == "cÅr"
end
+
+ it "works for non-ascii-compatible encodings" do
+ a = "ABC".encode("utf-16le")
+ a.downcase!(:ascii)
+ a.should == "abc".encode("utf-16le")
+ end
end
describe "full Unicode case mapping adapted for Turkic languages" do