diff options
| author | ruki <[email protected]> | 2022-07-23 00:58:25 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2022-07-23 00:58:25 +0800 |
| commit | b9327d0744edbf212120e77b345008954eac5851 (patch) | |
| tree | ac17340de1c46bebf85494df76cf7fbe97c5b9ac | |
| parent | 762532f952b8319fde777f657a4fe925dd7a4560 (diff) | |
improve tests
| -rw-r--r-- | tests/modules/fwatcher/watchdirs.lua | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/tests/modules/fwatcher/watchdirs.lua b/tests/modules/fwatcher/watchdirs.lua index cbe8914ef..9d3b81add 100644 --- a/tests/modules/fwatcher/watchdirs.lua +++ b/tests/modules/fwatcher/watchdirs.lua @@ -3,6 +3,14 @@ import("core.base.fwatcher") function main(watchdir) print("watch %s ..", watchdir) fwatcher.watchdirs(watchdir, function (event) - print(event) + local status + if event.type == fwatcher.ET_CREATE then + status = "created" + elseif event.type == fwatcher.ET_MODIFY then + status = "modified" + elseif event.type == fwatcher.ET_DELETE then + status = "deleted" + end + print(event.path, status) end) end |
