summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authornaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-02-16 08:34:45 +0000
committernaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-02-16 08:34:45 +0000
commit15f641a5f5c700603b81042bd39822b9b8c6296f (patch)
tree2fd7a72f5ab5bfc2007f4e0c7e997ef7709978c9 /test
parent55c5054c031cf0a5cb6a86fac5e0dca6f2e0faaa (diff)
merge revision(s) 61616: [Backport #14314]
marshal.c: allow marshalling keyword_init struct struct.c: define rb_struct_s_keyword_init to shared with marshal.c internal.h: add the declaration to be used by marshal.c test/ruby/test_marshal.rb: add test for Bug#14314 [Feature #14314] [ruby-core:84629] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_5@62428 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_marshal.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/test/ruby/test_marshal.rb b/test/ruby/test_marshal.rb
index 80ec0b1684..e269428dda 100644
--- a/test/ruby/test_marshal.rb
+++ b/test/ruby/test_marshal.rb
@@ -772,4 +772,11 @@ class TestMarshal < Test::Unit::TestCase
Marshal.dump(Bug12974.new)
end
end
+
+ Bug14314 = Struct.new(:foo, keyword_init: true)
+
+ def test_marshal_keyword_init_struct
+ obj = Bug14314.new(foo: 42)
+ assert_equal obj, Marshal.load(Marshal.dump(obj))
+ end
end