Bump to 1.14.1
[platform/upstream/augeas.git] / lenses / tests / test_simplevars.aug
1 (*
2 Module: Test_Simplevars
3   Provides unit tests and examples for the <Simplevars> lens.
4 *)
5
6 module Test_Simplevars =
7
8 (* Variable: conf *)
9 let conf = "# this is a comment
10
11 mykey = myvalue # eol comment
12 anotherkey = another value
13 "
14
15 (* Test: Simplevars.lns *)
16 test Simplevars.lns get conf =
17    { "#comment" = "this is a comment" }
18    { }
19    { "mykey" = "myvalue"
20      { "#comment" = "eol comment" } }
21    { "anotherkey" = "another value" }
22
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}'" }
27
28 (* Test: Simplevars.lns
29     Support flags *)
30 test Simplevars.lns get "dnsadminapp\n" =
31   { "dnsadminapp" }
32
33 (* Test: Simplevars.lns
34      Support empty values *)
35 test Simplevars.lns get "foo =\n" =
36   { "foo" = "" { } }