diff options
author | Samuel Giddins <[email protected]> | 2023-08-23 18:58:25 -0700 |
---|---|---|
committer | git <[email protected]> | 2023-09-20 02:03:02 +0000 |
commit | d3628e6ac4ac4703c88c594af649773205722287 (patch) | |
tree | d30d3d3bfebc3384eb5e223810edd6dbf24613f1 | |
parent | e52f9bd41e1c407ac675fa3d1fbaabec854f6968 (diff) |
[rubygems/rubygems] safe_load tests passing on jruby & truffleruby
https://github.com/rubygems/rubygems/commit/a64b21b052
-rw-r--r-- | test/rubygems/test_gem_safe_marshal.rb | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/test/rubygems/test_gem_safe_marshal.rb b/test/rubygems/test_gem_safe_marshal.rb index 36b11080f7..d9c430bc70 100644 --- a/test/rubygems/test_gem_safe_marshal.rb +++ b/test/rubygems/test_gem_safe_marshal.rb @@ -43,14 +43,16 @@ class TestGemSafeMarshal < Gem::TestCase def test_string_with_ivar str = String.new("abc") str.instance_variable_set :@type, "type" - with_const(Gem::SafeMarshal, :PERMITTED_IVARS, { "String" => %w[@type E] }) do + with_const(Gem::SafeMarshal, :PERMITTED_IVARS, { "String" => %w[@type E @debug_created_info] }) do assert_safe_load_as str end end def test_time_with_ivar - with_const(Gem::SafeMarshal, :PERMITTED_IVARS, { "Time" => %w[@type offset zone nano_num nano_den submicro], "String" => "E" }) do - assert_safe_load_as Time.new.tap {|t| t.instance_variable_set :@type, :runtime } + pend "Marshal.load of Time with ivars is broken on jruby, see https://github.com/jruby/jruby/issues/7902" if RUBY_ENGINE == "jruby" + + with_const(Gem::SafeMarshal, :PERMITTED_IVARS, { "Time" => %w[@type offset zone nano_num nano_den submicro], "String" => %w[E @debug_created_info] }) do + assert_safe_load_as Time.new.tap {|t| t.instance_variable_set :@type, "runtime" } end end @@ -113,6 +115,8 @@ class TestGemSafeMarshal < Gem::TestCase end def test_rational + pend "truffleruby dumps rationals with ivars set on array, see https://github.com/oracle/truffleruby/issues/3228" if RUBY_ENGINE == "truffleruby" + assert_safe_load_as Rational(1, 3) end |