summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2020-04-27 01:50:23 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2020-04-27 10:39:07 +0900
commit6009790e4072c8c6736773cf22addb20ad5aac02 (patch)
tree53b9c72c1f819abfb2d697fd050e26f2e1877051
parentc180c58fc17935a2bacffac57a3707d68b11eb4f (diff)
downloadruby-6009790e4072c8c6736773cf22addb20ad5aac02.tar.gz
Moved already resolved test
Couldn't figure out failed/fixed versions.
-rw-r--r--bootstraptest/pending.rb16
-rw-r--r--test/ruby/test_module.rb16
2 files changed, 16 insertions, 16 deletions
diff --git a/bootstraptest/pending.rb b/bootstraptest/pending.rb
index 66aab1e677..2c4b85a419 100644
--- a/bootstraptest/pending.rb
+++ b/bootstraptest/pending.rb
@@ -1,19 +1,3 @@
-assert_equal 'A', %q{
- class A
- @@a = 'A'
- def a=(x)
- @@a = x
- end
- def a
- @@a
- end
- end
-
- B = A.dup
- B.new.a = 'B'
- A.new.a
-}, '[ruby-core:17019]'
-
assert_equal 'ok', %q{
def m
lambda{
diff --git a/test/ruby/test_module.rb b/test/ruby/test_module.rb
index e5586edc6d..e3cd62713f 100644
--- a/test/ruby/test_module.rb
+++ b/test/ruby/test_module.rb
@@ -2161,6 +2161,22 @@ class TestModule < Test::Unit::TestCase
assert_equal([:@@bar], m2.class_variables(false))
end
+ def test_class_variable_in_dup_class
+ a = Class.new do
+ @@a = 'A'
+ def a=(x)
+ @@a = x
+ end
+ def a
+ @@a
+ end
+ end
+
+ b = a.dup
+ b.new.a = 'B'
+ assert_equal 'A', a.new.a, '[ruby-core:17019]'
+ end
+
Bug6891 = '[ruby-core:47241]'
def test_extend_module_with_protected_method