diff options
author | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2019-08-10 13:18:41 +0900 |
---|---|---|
committer | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2019-08-10 13:18:41 +0900 |
commit | ffdef3674af921d7ddd550dc492dcdbed97f7ba5 (patch) | |
tree | c2575b5307453e22085feb2cd586315c585f7266 /test | |
parent | 3c3783ac88f8f8fbbad016a2daf3e35a682c4b3e (diff) | |
download | ruby-ffdef3674af921d7ddd550dc492dcdbed97f7ba5.tar.gz |
Warn instance variable `E`
It is not dumped, as it is a short alias for `:encoding`.
Diffstat (limited to 'test')
-rw-r--r-- | test/-ext-/marshal/test_internal_ivar.rb | 8 |
1 files changed, 6 insertions, 2 deletions
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 |