core_assertions.rb: Fix backward compatibility with pre 2.7
This commit is contained in:
parent
27916db08c
commit
e340eb2106
@ -746,7 +746,7 @@ eom
|
|||||||
def assert_linear_performance(seq, rehearsal: nil, pre: ->(n) {n})
|
def assert_linear_performance(seq, rehearsal: nil, pre: ->(n) {n})
|
||||||
first = seq.first
|
first = seq.first
|
||||||
*arg = pre.call(first)
|
*arg = pre.call(first)
|
||||||
times = (0..(rehearsal || (2 * first))).filter_map do
|
times = (0..(rehearsal || (2 * first))).map do
|
||||||
st = Process.clock_gettime(Process::CLOCK_MONOTONIC)
|
st = Process.clock_gettime(Process::CLOCK_MONOTONIC)
|
||||||
yield(*arg)
|
yield(*arg)
|
||||||
t = (Process.clock_gettime(Process::CLOCK_MONOTONIC) - st)
|
t = (Process.clock_gettime(Process::CLOCK_MONOTONIC) - st)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user