From 62194c3e5dff8141813f9f63993516de98dd367f Mon Sep 17 00:00:00 2001 From: ruki Date: Sun, 7 Apr 2024 23:07:41 +0800 Subject: improve dlist --- tests/modules/table/test.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tests/modules/table/test.lua') diff --git a/tests/modules/table/test.lua b/tests/modules/table/test.lua index 2b586e7a4..306d07eac 100644 --- a/tests/modules/table/test.lua +++ b/tests/modules/table/test.lua @@ -31,7 +31,7 @@ function test_unwrap(t) end function test_orderkeys(t) - -- sort by modulo 2 then from the smallest to largest + -- sort by modulo 2 then from the smallest to largest local f = function(a, b) if a % 2 == 0 and b % 2 ~= 0 then return true @@ -40,7 +40,7 @@ function test_orderkeys(t) end return a < b end - + t:are_equal(table.orderkeys({[2] = 2, [1] = 1, [4] = 4, [3] = 3}, f), {2, 4, 1, 3}) t:are_equal(table.orderkeys({[1] = 1, [2] = 2, [3] = 3, [4] = 4}), {1, 2 , 3, 4}) end -- cgit v1.3.1