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 2022-06-26 14:50:14 +02:00
parent f616e81637
commit d3d5ef0cca
74 changed files with 1201 additions and 324 deletions

View file

@ -49,4 +49,13 @@ describe "String#dup" do
orig.should == "xtring"
dup.should == "string"
end
it "does not modify the original setbyte-mutated string when changing dupped string" do
orig = "a"
orig.setbyte 0, "b".ord
copy = orig.dup
orig.setbyte 0, "c".ord
orig.should == "c"
copy.should == "b"
end
end