1
0
mirror of https://github.com/janet-lang/janet synced 2025-09-10 06:46:08 +00:00

Add suite for testing filewatch.

Currently expects windows events.
This commit is contained in:
Calvin Rose
2024-08-18 09:45:21 -07:00
parent 33d2f9a522
commit c56d6e8fc1
5 changed files with 147 additions and 41 deletions

View File

@@ -64,3 +64,20 @@
(eprinf "Finished suite %s in %.3f seconds - " suite-name delta)
(eprint num-tests-passed " of " num-tests-run " tests passed.")
(if (not= num-tests-passed num-tests-run) (os/exit 1)))
(defn rmrf
"rm -rf in janet"
[x]
(case (os/lstat x :mode)
nil nil
:directory (do
(each y (os/dir x)
(rmrf (string x "/" y)))
(os/rmdir x))
(os/rm x))
nil)
(defn randdir
"Get a random directory name"
[]
(string "tmp_dir_" (slice (string (math/random) ".tmp") 2)))