liminix

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

test-svc.fnl (842B)


      1 (local svc (require :svc))
      2 (local { : view } (require :fennel))
      3 
      4 (local ex (svc.open "./example-output"))
      5 
      6 (assert (= (ex:output "name") "eth1"))
      7 
      8 (assert (=
      9          (table.concat (ex:output "colours"))
     10          (table.concat { :red "ff0000" :green "00ff00" :blu "0000ff" :black "000000" })))
     11 
     12 (assert (=
     13          (table.concat (ex:output "addresses"))
     14          (table.concat {:1 {:attribute "a11"}
     15                         :3 {:attribute "a33"}
     16                         :5 {:attribute "a55"}
     17                         :6 {:attribute "a66"}})))
     18 
     19 (let [dir (. arg 1)
     20       ex2 (svc.open dir)]
     21   (ex2:output "fish" "food")
     22   (ex2:output "nested/path/name" "value")
     23   (ex2:output "nested/path/complex" {
     24                                      :attribute "val"
     25                                      :other "42"
     26                                      }))