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-02-28 19:07:17 +01:00
parent 5d21050182
commit a0f5ff4c3c
75 changed files with 851 additions and 143 deletions

View file

@ -272,6 +272,16 @@ describe "C-API Array function" do
end
end
describe "RARRAY_ASET" do
# This macro does NOT do any bounds checking!
it "writes an element in the array" do
ary = [1, 2, 3]
@s.RARRAY_ASET(ary, 0, 0)
@s.RARRAY_ASET(ary, 2, 42)
ary.should == [0, 2, 42]
end
end
describe "rb_assoc_new" do
it "returns an array containing the two elements" do
@s.rb_assoc_new(1, 2).should == [1, 2]