Kim Alvefur
915ef3a222
util.cache: Pass cache itself to eviction callback
...
Simplifies access to the cache without moving code around a lot given
the currently common pattern of
local some_cache = cache.new(size, function(k,v) end)
2023-06-30 22:01:55 +02:00
Kim Alvefur
29b6ed4f0a
util.cache: Keep eviction candidate if callback resized to make room
...
Previously either the old or the new values would be rejected, even if
the cache was resized to allow more items.
2023-06-30 22:01:49 +02:00
Matthew Wild
f081c1a756
util.cache: Add some missing test cases
...
Found via mutation testing.
2022-10-13 09:55:36 +01:00
Kim Alvefur
14fceee089
tests: Remove special-casing of Lua 5.1
...
Part of #1600
2022-07-02 17:29:03 +02:00
Kim Alvefur
fdacac857f
util.cache: Add test for :table (fails on Lua 5.1)
2021-02-05 16:14:06 +01:00
Matthew Wild
24106955b4
util.cache tests: Add annotation to fix [luacheck] warning
2018-09-17 15:25:47 +01:00
Waqas Hussain
67293fc09f
Port tests to the busted
test runner
2017-09-15 17:07:57 -04:00