summaryrefslogtreecommitdiff
path: root/bootstraptest/test_yjit.rb
diff options
context:
space:
mode:
Diffstat (limited to 'bootstraptest/test_yjit.rb')
-rw-r--r--bootstraptest/test_yjit.rb39
1 files changed, 39 insertions, 0 deletions
diff --git a/bootstraptest/test_yjit.rb b/bootstraptest/test_yjit.rb
index 66b663b062..ebb19c8d3a 100644
--- a/bootstraptest/test_yjit.rb
+++ b/bootstraptest/test_yjit.rb
@@ -374,6 +374,45 @@ assert_equal 'false', %q{
less_than 2
}
+# BOP redefinition works on Integer#<=
+assert_equal 'false', %q{
+ def le(x, y) = x <= y
+
+ le(2, 2)
+
+ class Integer
+ def <=(_) = false
+ end
+
+ le(2, 2)
+}
+
+# BOP redefinition works on Integer#>
+assert_equal 'false', %q{
+ def gt(x, y) = x > y
+
+ gt(3, 2)
+
+ class Integer
+ def >(_) = false
+ end
+
+ gt(3, 2)
+}
+
+# BOP redefinition works on Integer#>=
+assert_equal 'false', %q{
+ def ge(x, y) = x >= y
+
+ ge(2, 2)
+
+ class Integer
+ def >=(_) = false
+ end
+
+ ge(2, 2)
+}
+
# Putobject, less-than operator, fixnums
assert_equal '2', %q{
def check_index(index)