2 Module: Test_Simplevars
3 Provides unit tests and examples for the <Simplevars> lens.
6 module Test_Simplevars =
9 let conf = "# this is a comment
11 mykey = myvalue # eol comment
12 anotherkey = another value
15 (* Test: Simplevars.lns *)
16 test Simplevars.lns get conf =
17 { "#comment" = "this is a comment" }
20 { "#comment" = "eol comment" } }
21 { "anotherkey" = "another value" }
23 (* Test: Simplevars.lns
24 Quotes are OK in variables that do not begin with a quote *)
25 test Simplevars.lns get "UserParameter=custom.vfs.dev.read.ops[*],cat /proc/diskstats | grep $1 | head -1 | awk '{print $$4}'\n" =
26 { "UserParameter" = "custom.vfs.dev.read.ops[*],cat /proc/diskstats | grep $1 | head -1 | awk '{print $$4}'" }
28 (* Test: Simplevars.lns
30 test Simplevars.lns get "dnsadminapp\n" =
33 (* Test: Simplevars.lns
34 Support empty values *)
35 test Simplevars.lns get "foo =\n" =