From 26df9588d6b55cc72526d7a45ebdd631600a6226 Mon Sep 17 00:00:00 2001 From: k0kubun Date: Fri, 5 Jan 2018 11:44:31 +0000 Subject: 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/trunk@61616 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_marshal.rb | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'test') 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 -- cgit v1.2.3