1
0
Fork 0
liminix/pkgs/ifwait/test-ifwait.fnl

16 lines
386 B
Plaintext
Raw Normal View History

2024-03-04 23:06:03 +00:00
(local fennel (require :fennel))
2024-03-05 18:06:29 +00:00
(fn event-fn [groups]
2024-03-04 23:06:03 +00:00
(let [data (with-open [e (io.open "events-fixture" "r")] (e:read "*a"))
parse (fennel.parser data)]
(coroutine.wrap
(fn []
(each [ok ast parse]
(if ok (coroutine.yield ast)))))))
(set _G.arg (doto ["-v" "dummy0" "up"] (tset 0 "test")))
2024-03-04 23:06:03 +00:00
(local ifwait (require :ifwait))
2024-03-05 18:06:29 +00:00
(ifwait.run event-fn)