Bump to 1.14.1
[platform/upstream/augeas.git] / lenses / tests / test_yaml.aug
1 module Test_YAML =
2
3 (* Inherit test *)
4 test YAML.lns get "host1:
5   <<: *production\n" =
6 { "host1"
7   { "<<" = "production" }
8 }
9
10 (* top level sequence *)
11 test YAML.lns get "
12 - foo: 1
13   bar: 2
14
15 - baz: 3
16   gee: 4
17 " =
18 {  }
19 { "@sequence"
20   { "foo" = "1" }
21   { "bar" = "2" }
22 }
23 {  }
24 { "@sequence"
25   { "baz" = "3" }
26   { "gee" = "4" }
27 }
28
29 test YAML.lns get "
30 defaults: &defaults
31   repo1: master
32   repo2: master
33
34 # Live
35 production: &production
36   # repo3: dc89d7a
37   repo4:   2d39995
38   # repo5: bc4a40d
39
40 host1:
41   <<: *production
42
43 host2:
44   <<: *defaults
45   repo6: branch1
46
47 host3:
48   <<: *defaults
49   # repo7: branch2
50   repo8:   branch3
51 " =
52 {}
53 { "defaults" = "defaults"
54   { "repo1" = "master" }
55   { "repo2" = "master" }
56 }
57 {}
58 { "#comment" = "Live" }
59 { "production" = "production"
60   { "#comment" = "repo3: dc89d7a" }
61   { "repo4" = "2d39995" }
62   { "#comment" = "repo5: bc4a40d" }
63 }
64 {}
65 { "host1"
66   { "<<" = "production" }
67 }
68 {}
69 { "host2"
70   { "<<" = "defaults" }
71   { "repo6" = "branch1" }
72 }
73 {}
74 { "host3"
75   { "<<" = "defaults" }
76   { "#comment" = "repo7: branch2" }
77   { "repo8" = "branch3" }
78 }
79
80 (* Ruby YAML header *)
81 test YAML.lns get "--- !ruby/object:Puppet::Node::Factspress RETURN)\n" =
82   { "@yaml" = "!ruby/object:Puppet::Node::Factspress RETURN)" }
83
84
85 (* Continued lines *)
86 test YAML.lns get "abc:
87   def: |-
88   ghi
89 \n" =
90   { "abc"
91     { "def"
92       { "@mval"
93         { "@line" = "ghi" } } } }
94