diff options
| author | Jean Boussier <jean.boussier@gmail.com> | 2025-03-13 13:29:37 +0100 |
|---|---|---|
| committer | Jean Boussier <jean.boussier@gmail.com> | 2025-03-14 09:51:57 +0100 |
| commit | de48e47ddf78aba02fd9623bc7ce685540a10743 (patch) | |
| tree | e4e7d409eb5d8343b85dc2628f5e1c8e7782b2dc /test | |
| parent | dd7deef338d843c8d866ddc279854068b39bfeb9 (diff) | |
Invoke `inherited` callbacks before `const_added`
[Misc #21143]
Conceptually this makes sense and is more consistent with using
the `Name = Class.new(Superclass)` alternative method.
However the new class is still named before `inherited` is called.
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/12927
Diffstat (limited to 'test')
| -rw-r--r-- | test/ruby/test_settracefunc.rb | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/test/ruby/test_settracefunc.rb b/test/ruby/test_settracefunc.rb index 55c07abbea..5542ad248a 100644 --- a/test/ruby/test_settracefunc.rb +++ b/test/ruby/test_settracefunc.rb @@ -168,14 +168,14 @@ class TestSetTraceFunc < Test::Unit::TestCase events.shift) assert_equal(["line", 4, __method__, self.class], events.shift) - assert_equal(["c-call", 4, :const_added, Module], - events.shift) - assert_equal(["c-return", 4, :const_added, Module], - events.shift) assert_equal(["c-call", 4, :inherited, Class], events.shift) assert_equal(["c-return", 4, :inherited, Class], events.shift) + assert_equal(["c-call", 4, :const_added, Module], + events.shift) + assert_equal(["c-return", 4, :const_added, Module], + events.shift) assert_equal(["class", 4, nil, nil], events.shift) assert_equal(["line", 5, nil, nil], @@ -411,10 +411,10 @@ class TestSetTraceFunc < Test::Unit::TestCase [["c-return", 2, :add_trace_func, Thread], ["line", 3, __method__, self.class], - ["c-call", 3, :const_added, Module], - ["c-return", 3, :const_added, Module], ["c-call", 3, :inherited, Class], ["c-return", 3, :inherited, Class], + ["c-call", 3, :const_added, Module], + ["c-return", 3, :const_added, Module], ["class", 3, nil, nil], ["line", 4, nil, nil], ["c-call", 4, :method_added, Module], @@ -558,10 +558,10 @@ class TestSetTraceFunc < Test::Unit::TestCase [:line, 5, 'xyzzy', self.class, method, self, :inner, :nothing], [:c_return, 4, "xyzzy", Array, :reverse_each, [1], nil, [1]], [:line, 7, 'xyzzy', self.class, method, self, :outer, :nothing], - [:c_call, 7, "xyzzy", Module, :const_added, TestSetTraceFunc, nil, :nothing], - [:c_return, 7, "xyzzy", Module, :const_added, TestSetTraceFunc, nil, nil], [:c_call, 7, "xyzzy", Class, :inherited, Object, nil, :nothing], [:c_return, 7, "xyzzy", Class, :inherited, Object, nil, nil], + [:c_call, 7, "xyzzy", Module, :const_added, TestSetTraceFunc, nil, :nothing], + [:c_return, 7, "xyzzy", Module, :const_added, TestSetTraceFunc, nil, nil], [:class, 7, "xyzzy", nil, nil, xyzzy.class, nil, :nothing], [:line, 8, "xyzzy", nil, nil, xyzzy.class, nil, :nothing], [:line, 9, "xyzzy", nil, nil, xyzzy.class, :XYZZY_outer, :nothing], |
