Files
jenz 08c03ac533
CI / Build (clang, clang++, ubuntu-22.04, linux, 3.10, master, x86,x86_64) (push) Canceled after 0s
CI / Build (clang, clang++, windows-2022, windows, 3.10, master, x86,x86_64) (push) Canceled after 0s
CI / Release (push) Canceled after 0s
first commit
2026-09-13 22:18:11 +01:00

27 lines
833 B
Ruby

assert('Range#max') do
# returns the maximum value in the range when called with no arguments
assert_equal 'l', ('f'..'l').max
assert_equal 'e', ('a'...'f').max
# returns nil when the endpoint is less than the start point
assert_equal nil, ('z'..'l').max
end
assert('Range#max given a block') do
# returns nil when the endpoint is less than the start point
assert_equal nil, (('z'..'l').max { |x, y| x <=> y })
end
assert('Range#min') do
# returns the minimum value in the range when called with no arguments
assert_equal 'f', ('f'..'l').min
# returns nil when the start point is greater than the endpoint
assert_equal nil, ('z'..'l').min
end
assert('Range#min given a block') do
# returns nil when the start point is greater than the endpoint
assert_equal nil, (('z'..'l').min { |x, y| x <=> y })
end