anoia.svc outputs may be directories (read as table)

This commit is contained in:
Daniel Barlow
2023-09-09 00:16:21 +01:00
parent 0312f7a999
commit 870da62a1e
12 changed files with 51 additions and 3 deletions

17
pkgs/anoia/test-svc.fnl Normal file
View File

@@ -0,0 +1,17 @@
(local svc (require :anoia.svc))
(local { : view } (require :fennel))
(local ex (svc.open "./example-output"))
(assert (= (ex:output "name") "eth1"))
(assert (=
(table.concat (ex:output "colours"))
(table.concat { :red "ff0000" :green "00ff00" :blu "0000ff" :black "000000" })))
(assert (=
(table.concat (ex:output "addresses"))
(table.concat {:1 {:attribute "a11"}
:3 {:attribute "a33"}
:5 {:attribute "a55"}
:6 {:attribute "a66"}})))