summaryrefslogtreecommitdiff
path: root/spec/ruby/optional/capi/array_spec.rb
diff options
context:
space:
mode:
authorBenoit Daloze <[email protected]>2020-02-28 19:07:17 +0100
committerBenoit Daloze <[email protected]>2020-02-28 19:07:17 +0100
commita0f5ff4c3cd05f8717be2bf1d79f0817f288d398 (patch)
tree441f409cf816cf8a61dacdbaf204ae9f5cbe2f18 /spec/ruby/optional/capi/array_spec.rb
parent5d210501825e1682e68cbfc2be424fc339f382fa (diff)
Update to ruby/spec@41bf282
Diffstat (limited to 'spec/ruby/optional/capi/array_spec.rb')
-rw-r--r--spec/ruby/optional/capi/array_spec.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/spec/ruby/optional/capi/array_spec.rb b/spec/ruby/optional/capi/array_spec.rb
index cf65bc19b6..6bb20e5921 100644
--- a/spec/ruby/optional/capi/array_spec.rb
+++ b/spec/ruby/optional/capi/array_spec.rb
@@ -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]