Software /
code /
prosody
Changeset
10998:f3fc0f799dc4
util.indexedbheap: Add failing test case for #1572
This approximates what happens if you add a timer far in the future,
then reschedule it to right now.
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Wed, 08 Jul 2020 21:39:10 +0200 |
parents | 10997:2451e3918c2c |
children | 10999:37b884d675f7 |
files | spec/util_indexedbheap_spec.lua |
diffstat | 1 files changed, 15 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/spec/util_indexedbheap_spec.lua Wed Jul 08 21:39:10 2020 +0200 @@ -0,0 +1,15 @@ +local ibh = require"util.indexedbheap"; +local h +setup(function () + h = ibh.create(); +end) +describe("util.indexedbheap", function () + pending("item can be moved from end to top", function () + h:insert("a", 1); + h:insert("b", 2); + h:insert("c", 3); + local id = h:insert("*", 10); + h:reprioritize(id, 0); + assert.same({ 0, "*", id }, { h:pop() }); + end) +end);