Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Include new_range_fixnum tests
  • Loading branch information
altxtech committed Sep 1, 2025
commit 472eef17506ecc6e056644b2dcbbe4fd28d4507f
54 changes: 54 additions & 0 deletions test/ruby/test_zjit.rb
Original file line number Diff line number Diff line change
Expand Up @@ -807,6 +807,60 @@ def test(n) = n..10
}
end

def test_new_range_fixnum_both_literals_inclusive
assert_compiles '1..2', %q{
def test()
(1..2)
end
test; test
}, call_threshold: 2
end

def test_new_range_fixnum_both_literals_exclusive
assert_compiles '1...2', %q{
def test()
(1...2)
end
test; test
}, call_threshold: 2
end

def test_new_range_fixnum_low_literal_inclusive
assert_compiles '1..3', %q{
def test(a)
(1..a)
end
test(2); test(3)
}, call_threshold: 2
end

def test_new_range_fixnum_low_literal_exclusive
assert_compiles '1...3', %q{
def test(a)
(1...a)
end
test(2); test(3)
}, call_threshold: 2
end

def test_new_range_fixnum_high_literal_inclusive
assert_compiles '3..10', %q{
def test(a)
(a..10)
end
test(2); test(3)
}, call_threshold: 2
end

def test_new_range_fixnum_high_literal_exclusive
assert_compiles '3...10', %q{
def test(a)
(a...10)
end
test(2); test(3)
}, call_threshold: 2
end

def test_if
assert_compiles '[0, nil]', %q{
def test(n)
Expand Down
Loading