Blame lenses/tests/test_simplevars.aug
|
Packit Service |
a2ae7a |
(*
|
|
Packit Service |
a2ae7a |
Module: Test_Simplevars
|
|
Packit Service |
a2ae7a |
Provides unit tests and examples for the <Simplevars> lens.
|
|
Packit Service |
a2ae7a |
*)
|
|
Packit Service |
a2ae7a |
|
|
Packit Service |
a2ae7a |
module Test_Simplevars =
|
|
Packit Service |
a2ae7a |
|
|
Packit Service |
a2ae7a |
(* Variable: conf *)
|
|
Packit Service |
a2ae7a |
let conf = "# this is a comment
|
|
Packit Service |
a2ae7a |
|
|
Packit Service |
a2ae7a |
mykey = myvalue # eol comment
|
|
Packit Service |
a2ae7a |
anotherkey = another value
|
|
Packit Service |
a2ae7a |
"
|
|
Packit Service |
a2ae7a |
|
|
Packit Service |
a2ae7a |
(* Test: Simplevars.lns *)
|
|
Packit Service |
a2ae7a |
test Simplevars.lns get conf =
|
|
Packit Service |
a2ae7a |
{ "#comment" = "this is a comment" }
|
|
Packit Service |
a2ae7a |
{ }
|
|
Packit Service |
a2ae7a |
{ "mykey" = "myvalue"
|
|
Packit Service |
a2ae7a |
{ "#comment" = "eol comment" } }
|
|
Packit Service |
a2ae7a |
{ "anotherkey" = "another value" }
|
|
Packit Service |
a2ae7a |
|
|
Packit Service |
a2ae7a |
(* Test: Simplevars.lns
|
|
Packit Service |
a2ae7a |
Quotes are OK in variables that do not begin with a quote *)
|
|
Packit Service |
a2ae7a |
test Simplevars.lns get "UserParameter=custom.vfs.dev.read.ops[*],cat /proc/diskstats | grep $1 | head -1 | awk '{print $$4}'\n" =
|
|
Packit Service |
a2ae7a |
{ "UserParameter" = "custom.vfs.dev.read.ops[*],cat /proc/diskstats | grep $1 | head -1 | awk '{print $$4}'" }
|
|
Packit Service |
a2ae7a |
|
|
Packit Service |
a2ae7a |
(* Test: Simplevars.lns
|
|
Packit Service |
a2ae7a |
Support flags *)
|
|
Packit Service |
a2ae7a |
test Simplevars.lns get "dnsadminapp\n" =
|
|
Packit Service |
a2ae7a |
{ "dnsadminapp" }
|
|
Packit Service |
a2ae7a |
|
|
Packit Service |
a2ae7a |
(* Test: Simplevars.lns
|
|
Packit Service |
a2ae7a |
Support empty values *)
|
|
Packit Service |
a2ae7a |
test Simplevars.lns get "foo =\n" =
|
|
Packit Service |
a2ae7a |
{ "foo" = "" { } }
|