We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e0498e6 commit 59a4054Copy full SHA for 59a4054
1 file changed
test/fiddle/test_cstruct.rb
@@ -0,0 +1,20 @@
1
+# frozen_string_literal: true
2
+begin
3
+ require_relative 'helper'
4
+rescue LoadError
5
+end
6
+
7
+module Fiddle
8
+ class TestStruct < TestCase
9
+ # https://github.com/ruby/fiddle/issues/66
10
+ def test_clone_gh_66
11
+ s = Fiddle::Importer.struct(["int i"])
12
+ a = s.malloc
13
+ a.i = 10
14
+ b = a.clone
15
+ b.i = 20
16
+ assert_equal({a: 10, b: 20},
17
+ {a: a.i, b: b.i})
18
+ end
19
20
0 commit comments