view spec/util_indexedbheap_spec.lua @ 11102:5a0ff475ecfd

util.error: Drop registry initialization with namespace as key Enough complexity with compact vs normal and with/without namespace
author Kim Alvefur <zash@zash.se>
date Mon, 28 Sep 2020 23:48:02 +0200
parents f3fc0f799dc4
children 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);