From 14cdec45c594346fe87eb9a5f76e08f3924aba48 Mon Sep 17 00:00:00 2001
From: Kim Alvefur <zash@zash.se>
Date: Wed, 8 Jul 2020 21:39:10 +0200
Subject: 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.
---
 spec/util_indexedbheap_spec.lua | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
 create mode 100644 spec/util_indexedbheap_spec.lua

(limited to 'spec')

diff --git a/spec/util_indexedbheap_spec.lua b/spec/util_indexedbheap_spec.lua
new file mode 100644
index 00000000..a76f94cb
--- /dev/null
+++ b/spec/util_indexedbheap_spec.lua
@@ -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);
-- 
cgit v1.2.3