diff options
author | Benoit Daloze <eregontp@gmail.com> | 2022-04-25 14:53:54 +0200 |
---|---|---|
committer | Benoit Daloze <eregontp@gmail.com> | 2022-04-25 14:53:54 +0200 |
commit | 45cf4f218728a15eb36d14a6c9912086525f5e3f (patch) | |
tree | 2aa93fadcb904c226f722dde47827098b87a9846 /spec/ruby/core/integer/chr_spec.rb | |
parent | 6ae81d49b52563a6720d666a6118ffa6e484f398 (diff) | |
download | ruby-45cf4f218728a15eb36d14a6c9912086525f5e3f.tar.gz |
Update to ruby/spec@3affe1e
Diffstat (limited to 'spec/ruby/core/integer/chr_spec.rb')
-rw-r--r-- | spec/ruby/core/integer/chr_spec.rb | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/spec/ruby/core/integer/chr_spec.rb b/spec/ruby/core/integer/chr_spec.rb index a919d29f12..3e13f45480 100644 --- a/spec/ruby/core/integer/chr_spec.rb +++ b/spec/ruby/core/integer/chr_spec.rb @@ -245,16 +245,14 @@ describe "Integer#chr with an encoding argument" do end end - ruby_version_is "2.7" do - it 'returns a String encoding self interpreted as a codepoint in the CESU-8 encoding' do - # see more details here https://en.wikipedia.org/wiki/CESU-8 - # code points from U+0000 to U+FFFF is encoded in the same way as in UTF-8 - 0x0045.chr(Encoding::CESU_8).bytes.should == 0x0045.chr(Encoding::UTF_8).bytes - - # code points in range from U+10000 to U+10FFFF is CESU-8 data containing a 6-byte surrogate pair, - # which decodes to a 4-byte UTF-8 string - 0x10400.chr(Encoding::CESU_8).bytes.should != 0x10400.chr(Encoding::UTF_8).bytes - 0x10400.chr(Encoding::CESU_8).bytes.to_a.should == [0xED, 0xA0, 0x81, 0xED, 0xB0, 0x80] - end + it 'returns a String encoding self interpreted as a codepoint in the CESU-8 encoding' do + # see more details here https://en.wikipedia.org/wiki/CESU-8 + # code points from U+0000 to U+FFFF is encoded in the same way as in UTF-8 + 0x0045.chr(Encoding::CESU_8).bytes.should == 0x0045.chr(Encoding::UTF_8).bytes + + # code points in range from U+10000 to U+10FFFF is CESU-8 data containing a 6-byte surrogate pair, + # which decodes to a 4-byte UTF-8 string + 0x10400.chr(Encoding::CESU_8).bytes.should != 0x10400.chr(Encoding::UTF_8).bytes + 0x10400.chr(Encoding::CESU_8).bytes.to_a.should == [0xED, 0xA0, 0x81, 0xED, 0xB0, 0x80] end end |