diff options
| author | Koichi Sasada <ko1@atdot.net> | 2021-02-18 17:10:39 +0900 |
|---|---|---|
| committer | Koichi Sasada <ko1@atdot.net> | 2022-01-13 17:43:14 +0900 |
| commit | 7e21b77dc6bfefaf331a0dbf89782303b8cda05d (patch) | |
| tree | 53de2f22527722e03837f2528448293dfe840e7a /test/ruby | |
| parent | 5a75151a0166ded78fc87ef5891a6877ba0950db (diff) | |
T#dup (T < Proc) should return T's object
T#dup (T < Proc) returns Proc object (not T) from Ruby 1.9.
[Bug #17545]
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/4197
Diffstat (limited to 'test/ruby')
| -rw-r--r-- | test/ruby/test_proc.rb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/test/ruby/test_proc.rb b/test/ruby/test_proc.rb index 05b2493b24..392b6be665 100644 --- a/test/ruby/test_proc.rb +++ b/test/ruby/test_proc.rb @@ -412,6 +412,11 @@ class TestProc < Test::Unit::TestCase assert_equal(:foo, bc.foo) end + def test_dup_subclass + c1 = Class.new(Proc) + assert_equal c1, c1.new{}.dup.class, '[Bug #17545]' + end + def test_binding b = proc {|x, y, z| proc {}.binding }.call(1, 2, 3) class << b; attr_accessor :foo; end |
