From 97a81f889ae1486a1c16039bc6fbac5806033af1 Mon Sep 17 00:00:00 2001 From: actboy168 Date: Tue, 13 Feb 2024 09:56:21 +0800 Subject: [PATCH] update test --- test/test_filewatch.lua | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/test/test_filewatch.lua b/test/test_filewatch.lua index a7d39acd..f30f7a76 100644 --- a/test/test_filewatch.lua +++ b/test/test_filewatch.lua @@ -41,13 +41,20 @@ function test_fw:test_2() fs.rename(root / "file_1", root / "file_2") fs.remove(root / "file_2") + local function has(t, a) + for _, v in ipairs(t) do + if v == a then + return true + end + end + end local list = {} local n = 100 while true do local w, v = fw:select() if w then n = 100 - if list[#list] ~= v then + if not has(list, v) and root:string() ~= v then list[#list+1] = v end else