summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorduerst <duerst@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-05-19 08:19:02 +0000
committerduerst <duerst@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-05-19 08:19:02 +0000
commit94ddec6f9c2eb8beef16ce26201b2e1af4da0daf (patch)
tree4887a64804a2de8d851b1f50e5b3a037291b1d0e /spec
parent0cbe2cfd6516da15fb5414a4fbadbe305237a7ad (diff)
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
Diffstat (limited to 'spec')
-rw-r--r--spec/rubyspec/core/string/capitalize_spec.rb6
-rw-r--r--spec/rubyspec/core/string/downcase_spec.rb6
-rw-r--r--spec/rubyspec/core/string/swapcase_spec.rb6
-rw-r--r--spec/rubyspec/core/string/upcase_spec.rb6
4 files changed, 24 insertions, 0 deletions
diff --git a/spec/rubyspec/core/string/capitalize_spec.rb b/spec/rubyspec/core/string/capitalize_spec.rb
index b70509da99..e2d2b68caa 100644
--- a/spec/rubyspec/core/string/capitalize_spec.rb
+++ b/spec/rubyspec/core/string/capitalize_spec.rb
@@ -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)
diff --git a/spec/rubyspec/core/string/downcase_spec.rb b/spec/rubyspec/core/string/downcase_spec.rb
index d31b6633df..9ebc4f2bd1 100644
--- a/spec/rubyspec/core/string/downcase_spec.rb
+++ b/spec/rubyspec/core/string/downcase_spec.rb
@@ -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
diff --git a/spec/rubyspec/core/string/swapcase_spec.rb b/spec/rubyspec/core/string/swapcase_spec.rb
index 0085887ae2..e9af647727 100644
--- a/spec/rubyspec/core/string/swapcase_spec.rb
+++ b/spec/rubyspec/core/string/swapcase_spec.rb
@@ -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)
diff --git a/spec/rubyspec/core/string/upcase_spec.rb b/spec/rubyspec/core/string/upcase_spec.rb
index e23a9829d9..2fdcce86b9 100644
--- a/spec/rubyspec/core/string/upcase_spec.rb
+++ b/spec/rubyspec/core/string/upcase_spec.rb
@@ -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