File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change 75
75
76
76
it "returns the string length based on a fixed-width encoding's character length, even if the encoding is incompatible" do
77
77
@s . rb_enc_strlen ( @str , @str . bytesize , Encoding ::UTF_16BE ) . should == 6
78
+ @s . rb_enc_strlen ( @str , @str . bytesize , Encoding ::UTF_16LE ) . should == 6
78
79
@s . rb_enc_strlen ( @str , @str . bytesize , Encoding ::UTF_32BE ) . should == 3
80
+ @s . rb_enc_strlen ( @str , @str . bytesize , Encoding ::UTF_32LE ) . should == 3
79
81
end
80
82
81
83
it "does not consider strings to be NUL-terminated" do
91
93
@s . rb_enc_strlen ( @str , 5 , Encoding ::UTF_8 ) . should == 3
92
94
end
93
95
94
- it "rounds up for fixed-width encodings " do
96
+ it "combines valid character and invalid character counts in UTF-16 " do
95
97
@s . rb_enc_strlen ( @str , 5 , Encoding ::UTF_16BE ) . should == 3
98
+ end
99
+
100
+ it "rounds up for fixed-width encodings" do
96
101
@s . rb_enc_strlen ( @str , 5 , Encoding ::UTF_32BE ) . should == 2
102
+ @s . rb_enc_strlen ( @str , 5 , Encoding ::UTF_32LE ) . should == 2
97
103
@s . rb_enc_strlen ( @str , 5 , Encoding ::BINARY ) . should == 5
98
104
end
99
105
end
You can’t perform that action at this time.
0 commit comments