mirror of
https://github.com/TangentFoxy/lume.git
synced 2025-07-28 02:52:21 +00:00
Fixed lume.ripairs() for falsey values; added test
This commit is contained in:
@@ -581,12 +581,12 @@ end
|
||||
|
||||
-- lume.ripairs
|
||||
tests["lume.ripairs"] = function()
|
||||
local t = { "a", "b", "c" }
|
||||
local t = { "a", "b", false, "c" }
|
||||
local r = {}
|
||||
for i, v in lume.ripairs(t) do
|
||||
table.insert(r, { i, v })
|
||||
end
|
||||
testeq( r, { { 3, "c" }, { 2, "b" }, { 1, "a" } })
|
||||
testeq( r, { { 4, "c" }, { 3, false }, { 2, "b" }, { 1, "a" } })
|
||||
tester.test.error(lume.ripairs, nil)
|
||||
end
|
||||
|
||||
|
Reference in New Issue
Block a user