diff options
author | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-01-21 08:36:01 +0000 |
---|---|---|
committer | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-01-21 08:36:01 +0000 |
commit | 0b5cd2822c2589a5d5670a651d21f20908eddbe2 (patch) | |
tree | eb4b8dba4508868e6fc4625e610abcd432d57f41 /test/ruby | |
parent | 340e7b8e1b091b765289f2b26f75a8499d666633 (diff) | |
download | ruby-0b5cd2822c2589a5d5670a651d21f20908eddbe2.tar.gz |
* marshal.c (r_object0): honor Marshal.load post proc
value for TYPE_LINK. by Hiroshi Nakamura <nahi@ruby-lang.org>
https://github.com/ruby/ruby/pull/1204 fix GH-1204
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53609 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby')
-rw-r--r-- | test/ruby/test_marshal.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/test/ruby/test_marshal.rb b/test/ruby/test_marshal.rb index 482637fa12..8377de2155 100644 --- a/test/ruby/test_marshal.rb +++ b/test/ruby/test_marshal.rb @@ -712,4 +712,10 @@ class TestMarshal < Test::Unit::TestCase assert_predicate(status, :success?) assert_equal(expected, out) end + + def test_marshal_honor_post_proc_value_for_link + str = 'x' # for link + obj = [str, str] + assert_equal(['X', 'X'], Marshal.load(Marshal.dump(obj), ->(v) { v == str ? v.upcase : v })) + end end |