diff options
Diffstat (limited to 'test/ruby')
| -rw-r--r-- | test/ruby/test_zjit.rb | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/test/ruby/test_zjit.rb b/test/ruby/test_zjit.rb index 2642467d73..c11f7bfa9a 100644 --- a/test/ruby/test_zjit.rb +++ b/test/ruby/test_zjit.rb @@ -1665,6 +1665,23 @@ class TestZJIT < Test::Unit::TestCase }, call_threshold: 2 end + def test_method_redefinition_with_module + assert_runs '["original", "redefined"]', %q{ + module Foo + def self.foo = "original" + end + + def test = Foo.foo + test + result1 = test + + def Foo.foo = "redefined" + result2 = test + + [result1, result2] + }, call_threshold: 2 + end + def test_module_name_with_guard_passes assert_compiles '"Integer"', %q{ def test(mod) |
