diff options
Diffstat (limited to 'bootstraptest')
-rw-r--r-- | bootstraptest/test_yjit.rb | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/bootstraptest/test_yjit.rb b/bootstraptest/test_yjit.rb index 33e9a35462..f1900f9f3f 100644 --- a/bootstraptest/test_yjit.rb +++ b/bootstraptest/test_yjit.rb @@ -1214,6 +1214,23 @@ assert_equal 'foo123', %q{ make_str("foo", 123) } +# test string interpolation with overridden to_s +assert_equal 'foo', %q{ + class String + def to_s + "bad" + end + end + + def make_str(foo) + "#{foo}" + end + + make_str("foo") + make_str("foo") +} + + # test invokebuiltin as used in struct assignment assert_equal '123', %q{ def foo(obj) |