diff options
Diffstat (limited to 'bootstraptest')
-rw-r--r-- | bootstraptest/test_yjit.rb | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/bootstraptest/test_yjit.rb b/bootstraptest/test_yjit.rb index 866d7e2558..8ddff90050 100644 --- a/bootstraptest/test_yjit.rb +++ b/bootstraptest/test_yjit.rb @@ -1950,3 +1950,29 @@ assert_equal '42', %q{ ractor.take } + +# Test equality with changing types +assert_equal '[true, false, false, false]', %q{ + def eq(a, b) + a == b + end + + [ + eq("foo", "foo"), + eq("foo", "bar"), + eq(:foo, "bar"), + eq("foo", :bar) + ] +} + +# Redefined eq +assert_equal 'true', %q{ + class String + def ==(other) + true + end + end + + "foo" == "bar" + "foo" == "bar" +} |