Skip to content

Commit

Permalink
test: make iterate_with() conform to declared interface
Browse files Browse the repository at this point in the history
According to expirationd documentation user's function iterate_with must
accept task object and return an iterator. Patch fixes iterate_with
function defined for testing needs.

Closes #84
  • Loading branch information
ligurio committed Oct 15, 2021
1 parent 89eac36 commit 5e93c6e
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions test/helper.lua
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,13 @@ function helpers.truncate_spaces(g)
g.vinyl:truncate()
end

function helpers.is_expired_true()
return true
function helpers.is_expired_true(task)
return task.index:pairs(task.start_key(), { iterator = task.iterator_type })
:take_while(
function()
return task:process_while()
end
)
end

helpers.iteration_result = {}
Expand Down

0 comments on commit 5e93c6e

Please sign in to comment.