mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Update to ruby/spec@f8a2d54
This commit is contained in:
parent
ed377cc9aa
commit
809f0b8a13
76 changed files with 2451 additions and 224 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue