diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_jit.rb | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/test/ruby/test_jit.rb b/test/ruby/test_jit.rb index 9b50a32a52..b2467fe074 100644 --- a/test/ruby/test_jit.rb +++ b/test/ruby/test_jit.rb @@ -697,6 +697,28 @@ class TestJIT < Test::Unit::TestCase end; end + def test_inlined_setivar_frozen + assert_eval_with_jit("#{<<~"begin;"}\n#{<<~"end;"}", stdout: "FrozenError\n", success_count: 1, min_calls: 3) + begin; + class A + def a + @a = 1 + end + end + + a = A.new + a.a + a.a + a.a + a.freeze + begin + a.a + rescue FrozenError => e + p e.class + end + end; + end + def test_attr_reader assert_eval_with_jit("#{<<~"begin;"}\n#{<<~"end;"}", stdout: "4nil\nnil\n6", success_count: 2, min_calls: 2) begin; |