Skip to content

Commit

Permalink
Add test to reproduce the issue reported in GH-66
Browse files Browse the repository at this point in the history
  • Loading branch information
mrkn committed Jan 31, 2021
1 parent e0498e6 commit d7d5836
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions test/fiddle/test_struct.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# frozen_string_literal: true
begin
require_relative 'helper'
rescue LoadError
end

module Fiddle
class TestStruct < TestCase
# https://github.com/ruby/fiddle/issues/66
def test_clone_gh_66
s = Fiddle::Importer.struct(["int i"])
a = s.malloc
a.i = 10
b = a.clone
b.i = 20
assert_equal({a: 10, b: 20},
{a: a.i, b: b.i})
end
end
end

0 comments on commit d7d5836

Please sign in to comment.