Software /
code /
prosody
Comparison
spec/util_indexedbheap_spec.lua @ 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 |
child | 11116:d334f2bebe55 |
comparison
equal
deleted
inserted
replaced
10997:2451e3918c2c | 10998:f3fc0f799dc4 |
---|---|
1 local ibh = require"util.indexedbheap"; | |
2 local h | |
3 setup(function () | |
4 h = ibh.create(); | |
5 end) | |
6 describe("util.indexedbheap", function () | |
7 pending("item can be moved from end to top", function () | |
8 h:insert("a", 1); | |
9 h:insert("b", 2); | |
10 h:insert("c", 3); | |
11 local id = h:insert("*", 10); | |
12 h:reprioritize(id, 0); | |
13 assert.same({ 0, "*", id }, { h:pop() }); | |
14 end) | |
15 end); |