summaryrefslogtreecommitdiff
path: root/tests/modules/fwatcher/watchdir.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2022-07-23 00:41:45 +0800
committerruki <[email protected]>2022-07-23 00:41:45 +0800
commit08f1f473ba31ac3720c3ecf3cc5afac04947eab6 (patch)
treebc35b7bdcb7147b2c820203a51a08d6d5b879a2c /tests/modules/fwatcher/watchdir.lua
parent8cb0768ed29c7ea78cd27fdd3febc66c2d2ddce9 (diff)
add tests
Diffstat (limited to 'tests/modules/fwatcher/watchdir.lua')
-rw-r--r--tests/modules/fwatcher/watchdir.lua11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/modules/fwatcher/watchdir.lua b/tests/modules/fwatcher/watchdir.lua
new file mode 100644
index 000000000..d73d7ff9f
--- /dev/null
+++ b/tests/modules/fwatcher/watchdir.lua
@@ -0,0 +1,11 @@
+import("core.base.fwatcher")
+
+function main(watchdir)
+ fwatcher.add(watchdir)
+ while true do
+ local ok, event = fwatcher.wait(-1)
+ if ok > 0 then
+ print(event)
+ end
+ end
+end