1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

add specs for Unicode-wide case conversions introduced in Ruby 2.4

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58790 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
duerst 2017-05-19 08:19:02 +00:00
parent 0cbe2cfd65
commit 94ddec6f9c
4 changed files with 24 additions and 0 deletions

View file

@ -25,6 +25,12 @@ describe "String#capitalize" do
end
end
ruby_version_is '2.4' do
it "works for all of Unicode" do
"äöü".capitalize.should == "Äöü"
end
end
it "returns subclass instances when called on a subclass" do
StringSpecs::MyString.new("hello").capitalize.should be_an_instance_of(StringSpecs::MyString)
StringSpecs::MyString.new("Hello").capitalize.should be_an_instance_of(StringSpecs::MyString)

View file

@ -22,6 +22,12 @@ describe "String#downcase" do
end
end
ruby_version_is '2.4' do
it "works for all of Unicode" do
"ÄÖÜ".downcase.should == "äöü"
end
end
it "taints result when self is tainted" do
"".taint.downcase.tainted?.should == true
"x".taint.downcase.tainted?.should == true

View file

@ -22,6 +22,12 @@ describe "String#swapcase" do
end
end
ruby_version_is '2.4' do
it "works for all of Unicode" do
"äÖü".swapcase.should == "ÄöÜ"
end
end
it "returns subclass instances when called on a subclass" do
StringSpecs::MyString.new("").swapcase.should be_an_instance_of(StringSpecs::MyString)
StringSpecs::MyString.new("hello").swapcase.should be_an_instance_of(StringSpecs::MyString)

View file

@ -22,6 +22,12 @@ describe "String#upcase" do
end
end
ruby_version_is '2.4' do
it "works for all of Unicode" do
"äöü".upcase.should == "ÄÖÜ"
end
end
it "taints result when self is tainted" do
"".taint.upcase.tainted?.should == true
"X".taint.upcase.tainted?.should == true