diff options
| author | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2023-08-20 13:04:06 +0900 |
|---|---|---|
| committer | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2025-03-12 18:42:38 +0900 |
| commit | 9459bedd84d479bb1d7d3d40bada1cecb4701c37 (patch) | |
| tree | 8b02a023290b4c05c7203d203e6fbc7d7d9958d6 /test/ruby | |
| parent | 2782cc75a99751228bc55d6d0f04d3a1742087fa (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.rb | 9 |
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 { |
