From 541c59cd25ccd70cece01237b88efb8e78964da5 Mon Sep 17 00:00:00 2001 From: duerst Date: Fri, 19 May 2017 08:19:02 +0000 Subject: 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 --- spec/rubyspec/core/string/capitalize_spec.rb | 6 ++++++ spec/rubyspec/core/string/downcase_spec.rb | 6 ++++++ spec/rubyspec/core/string/swapcase_spec.rb | 6 ++++++ spec/rubyspec/core/string/upcase_spec.rb | 6 ++++++ 4 files changed, 24 insertions(+) (limited to 'spec') 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 -- cgit v1.2.3