summaryrefslogtreecommitdiff
path: root/test/ruby
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2023-08-20 13:04:06 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2025-03-12 18:42:38 +0900
commit9459bedd84d479bb1d7d3d40bada1cecb4701c37 (patch)
tree8b02a023290b4c05c7203d203e6fbc7d7d9958d6 /test/ruby
parent2782cc75a99751228bc55d6d0f04d3a1742087fa (diff)
[Bug #19841] Refine error on marshaling recursive USERDEF
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/12914
Diffstat (limited to 'test/ruby')
-rw-r--r--test/ruby/test_marshal.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/ruby/test_marshal.rb b/test/ruby/test_marshal.rb
index bcd8892f23..404a954c4b 100644
--- a/test/ruby/test_marshal.rb
+++ b/test/ruby/test_marshal.rb
@@ -676,6 +676,15 @@ class TestMarshal < Test::Unit::TestCase
end
end
+ def test_recursive_userdef
+ t = Time.utc(0)
+ str = "b".b
+ t.instance_eval {@v = t}
+ assert_raise_with_message(RuntimeError, /recursive\b.*\b_dump/) do
+ Marshal.dump(t)
+ end
+ end
+
def test_unloadable_usrmarshal
c = eval("class UsrMarshal\u{23F0 23F3}<Time;self;end")
c.class_eval {