diff options
author | Benoit Daloze <[email protected]> | 2023-02-27 21:02:44 +0100 |
---|---|---|
committer | Benoit Daloze <[email protected]> | 2023-02-27 21:02:44 +0100 |
commit | 18b4def471bb901d0baa4a1307185484cb05815f (patch) | |
tree | 779b24566144e9ee06c6f8de35bd2f7fd74ccdb4 /spec/ruby/core/symbol | |
parent | de60139053fa7c561858c5c5556d61c82f361dd9 (diff) |
Update to ruby/spec@e7dc804
Diffstat (limited to 'spec/ruby/core/symbol')
-rw-r--r-- | spec/ruby/core/symbol/casecmp_spec.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/spec/ruby/core/symbol/casecmp_spec.rb b/spec/ruby/core/symbol/casecmp_spec.rb index 80ea51e910..662a29a284 100644 --- a/spec/ruby/core/symbol/casecmp_spec.rb +++ b/spec/ruby/core/symbol/casecmp_spec.rb @@ -56,6 +56,10 @@ describe "Symbol#casecmp with Symbol" do lower_a_tilde.casecmp(upper_a_tilde).should == 1 lower_a_umlaut.casecmp(upper_a_umlaut).should == 1 end + + it "returns 0 for empty strings in different encodings" do + ''.to_sym.casecmp(''.encode("UTF-32LE").to_sym).should == 0 + end end describe "Symbol#casecmp" do @@ -141,4 +145,8 @@ describe 'Symbol#casecmp?' do upper_a_tilde.casecmp?(lower_a_tilde).should == nil lower_a_tilde.casecmp?(upper_a_tilde).should == nil end + + it "returns true for empty symbols in different encodings" do + ''.to_sym.should.casecmp?(''.encode("UTF-32LE").to_sym) + end end |