summaryrefslogtreecommitdiff
path: root/test/-ext-
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2019-08-10 13:18:41 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2019-08-10 13:18:41 +0900
commitffdef3674af921d7ddd550dc492dcdbed97f7ba5 (patch)
treec2575b5307453e22085feb2cd586315c585f7266 /test/-ext-
parent3c3783ac88f8f8fbbad016a2daf3e35a682c4b3e (diff)
Warn instance variable `E`
It is not dumped, as it is a short alias for `:encoding`.
Diffstat (limited to 'test/-ext-')
-rw-r--r--test/-ext-/marshal/test_internal_ivar.rb8
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 5152966..a32138f 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