diff options
Diffstat (limited to 'spec/ruby/optional/capi/array_spec.rb')
-rw-r--r-- | spec/ruby/optional/capi/array_spec.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/spec/ruby/optional/capi/array_spec.rb b/spec/ruby/optional/capi/array_spec.rb index acd225e0e0..cf65bc19b6 100644 --- a/spec/ruby/optional/capi/array_spec.rb +++ b/spec/ruby/optional/capi/array_spec.rb @@ -249,6 +249,14 @@ describe "C-API Array function" do @s.RARRAY_PTR_assign(a, :set) a.should == [:set, :set, :set] end + + it "allows memcpying between arrays" do + a = [1, 2, 3] + b = [0, 0, 0] + @s.RARRAY_PTR_memcpy(a, b) + b.should == [1, 2, 3] + a.should == [1, 2, 3] # check a was not modified + end end describe "RARRAY_LEN" do |