1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
This commit is contained in:
Benoit Daloze 2020-01-28 20:47:48 +01:00
parent ed377cc9aa
commit 809f0b8a13
76 changed files with 2451 additions and 224 deletions

View file

@ -23,4 +23,17 @@ describe :string_length, shared: true do
str.force_encoding('BINARY').send(@method).should == 12
end
it "returns the correct length after force_encoding(BINARY)" do
utf8 = ""
ascii = "a"
concat = utf8 + ascii
concat.encoding.should == Encoding::UTF_8
concat.bytesize.should == 4
concat.size.should == 2
concat.force_encoding(Encoding::ASCII_8BIT)
concat.size.should == 4
end
end