File

spec/util_indexedbheap_spec.lua @ 11005:cff243aafdce

prosodyctl about: Strip name from lua module _VERSION Some modules have _VERSION = "LuaModule x.y.z", so it is a bit weird to show the name twice.
author Kim Alvefur <zash@zash.se>
date Fri, 10 Jul 2020 03:29:06 +0200 (2020-07-10)
parent 10998:f3fc0f799dc4
child 11116:d334f2bebe55
line wrap: on
line source
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);