summaryrefslogtreecommitdiff
path: root/test/-ext-
diff options
context:
space:
mode:
authorNobuyoshi Nakada <[email protected]>2025-03-13 13:37:01 +0900
committerNobuyoshi Nakada <[email protected]>2025-03-17 23:42:16 +0900
commit8d6f153fba8ce48a8e31cb22a9c9222bbb1832f6 (patch)
tree1694c1431e446998d1cadffc5f97674e96e3689e /test/-ext-
parent4c072c811905610a84107fdae103982d144b3d71 (diff)
Manage skipping instance variable IDs in one place
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/12923
Diffstat (limited to 'test/-ext-')
-rw-r--r--test/-ext-/marshal/test_internal_ivar.rb10
1 files changed, 8 insertions, 2 deletions
diff --git a/test/-ext-/marshal/test_internal_ivar.rb b/test/-ext-/marshal/test_internal_ivar.rb
index faabe14ab2..8b4667fdf9 100644
--- a/test/-ext-/marshal/test_internal_ivar.rb
+++ b/test/-ext-/marshal/test_internal_ivar.rb
@@ -7,11 +7,16 @@ module Bug end
module Bug::Marshal
class TestInternalIVar < Test::Unit::TestCase
def test_marshal
- v = InternalIVar.new("hello", "world", "bye")
+ v = InternalIVar.new("hello", "world", "bye", "hi")
assert_equal("hello", v.normal)
assert_equal("world", v.internal)
assert_equal("bye", v.encoding_short)
- dump = assert_warn(/instance variable 'E' on class \S+ is not dumped/) {
+ assert_equal("hi", v.encoding_long)
+ warnings = ->(s) {
+ w = s.scan(/instance variable '(.+?)' on class \S+ is not dumped/)
+ assert_equal(%w[E K encoding], w.flatten.sort)
+ }
+ dump = assert_warn(warnings) {
::Marshal.dump(v)
}
v = assert_nothing_raised {break ::Marshal.load(dump)}
@@ -19,6 +24,7 @@ module Bug::Marshal
assert_equal("hello", v.normal)
assert_nil(v.internal)
assert_nil(v.encoding_short)
+ assert_nil(v.encoding_long)
end
end
end