From ffdef3674af921d7ddd550dc492dcdbed97f7ba5 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Sat, 10 Aug 2019 13:18:41 +0900 Subject: Warn instance variable `E` It is not dumped, as it is a short alias for `:encoding`. --- test/-ext-/marshal/test_internal_ivar.rb | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'test/-ext-/marshal') diff --git a/test/-ext-/marshal/test_internal_ivar.rb b/test/-ext-/marshal/test_internal_ivar.rb index 51529667b5..a32138f6e8 100644 --- a/test/-ext-/marshal/test_internal_ivar.rb +++ b/test/-ext-/marshal/test_internal_ivar.rb @@ -7,14 +7,18 @@ module Bug end module Bug::Marshal class TestInternalIVar < Test::Unit::TestCase def test_marshal - v = InternalIVar.new("hello", "world") + v = InternalIVar.new("hello", "world", "bye") assert_equal("hello", v.normal) assert_equal("world", v.internal) - dump = ::Marshal.dump(v) + assert_equal("bye", v.encoding_short) + dump = assert_warn(/instance variable `E' on class \S+ is not dumped/) { + ::Marshal.dump(v) + } v = assert_nothing_raised {break ::Marshal.load(dump)} assert_instance_of(InternalIVar, v) assert_equal("hello", v.normal) assert_nil(v.internal) + assert_nil(v.encoding_short) end end end -- cgit v1.2.1