File tree Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -49,13 +49,24 @@ def to_str
49
49
@s . rb_str_set_len ( @str , 8 ) . should == "abcde\x00 gh"
50
50
end
51
51
52
- it "updates the byte size and character size " do
52
+ it "updates the byte size" do
53
53
@s . rb_str_set_len ( @str , 4 )
54
54
@str . bytesize . should == 4
55
+ @str . should == "abcd"
56
+ end
57
+
58
+ it "invalidates the character size" do
59
+ @str . size . should == 10
60
+ @s . rb_str_set_len ( @str , 4 )
55
61
@str . size . should == 4
56
62
@str . should == "abcd"
57
63
end
58
64
65
+ it "invalidates the code range" do
66
+ @s . rb_str_set_len ( @str , 4 )
67
+ @str . ascii_only? . should == true
68
+ end
69
+
59
70
it "updates the string's attributes visible in C code" do
60
71
@s . rb_str_set_len_RSTRING_LEN ( @str , 4 ) . should == 4
61
72
end
Original file line number Diff line number Diff line change 1
1
fails:SafeStringValue raises for tained string when $SAFE is 1
2
+ fails:C-API String function rb_str_set_len on a ASCII-8BIT String invalidates the code range
You can’t perform that action at this time.
0 commit comments