source: trunk/TestingSuite/ypath.yml @ 71

Revision 71, 2.9 KB checked in by tim, 10 years ago (diff)

initial yaml commit of latest version downloaded from  http://www.yaml.org/dist/PyYaml.tgz

  • Property svn:executable set to *
Line 
1data:
2  apple: red
3ypath: /
4expected:
5 - /
6---
7data:
8  apple: red
9ypath: .
10expected:
11 - /
12---
13data:
14  apple: red
15ypath: /*
16expected:
17 - /apple
18---
19data:
20  apple: red
21  lemon: yellow
22ypath: /*
23expected:
24 - /apple
25 - /lemon
26unordered: 1
27---
28data:
29  fruit:
30    banana: yellow
31  vegetable:
32    carrot: orange
33ypath: //.
34expected: 
35  - /
36  - /fruit
37  - /fruit/banana
38  - /vegetable
39  - /vegetable/carrot
40unordered: 1
41---
42data:
43  one:
44    two: xxx
45ypath: //two/..
46expected:
47 - /one
48---
49data:
50  apple: red
51ypath: /apple
52expected:
53 - /apple
54-----
55data:
56  apple: red
57  lemon: yellow
58ypath: /"lemon"
59expected:
60 - /lemon
61-----
62data:
63  apple: red
64  lemon: yellow
65ypath: /'lemon'
66expected:
67 - /lemon
68-----
69data:
70  apple: red
71  lemon: yellow
72ypath: /lemon
73expected:
74 - /lemon
75----
76data:
77  - apple
78  - lemon
79ypath: /0
80expected:
81 - /0
82---
83data:
84  apple: red
85  lemon: yellow
86ypath: /orange
87expected: []
88----
89data:
90  apple: red
91ypath: ./.
92expected:
93 - /
94---
95data:
96  fruit:
97    banana: yellow
98  vegetable:
99    carrot: orange
100ypath: /fruit/banana
101expected:
102 - /fruit/banana
103---
104data:
105  fruit:
106    banana: yellow
107  vegetable:
108    carrot: orange
109ypath: fruit/banana
110expected:
111 - /fruit/banana
112---
113data:
114  names:
115    - Steve Howell
116    - Clark Evans
117ypath: /names/0
118expected:
119 - /names/0
120---
121data:
122  names:
123    - first: Clark
124      last:  Evans
125    - first: Steve
126      last:  Howell
127ypath: /names/1/first
128expected:
129  - /names/1/first
130----
131data:
132  names:
133    - first: Clark
134      last:  Evans
135    - first: Steve
136      last:  Howell
137ypath: /names/*/first
138expected:
139  - /names/0/first
140  - /names/1/first
141---
142data:
143  names:
144    python-heads:
145      - first: Clark
146        last:  Evans
147      - first: Steve
148        last:  Howell
149    perl-heads:
150      - first: Brian
151        last:  Ingerson
152ypath: names//first
153expected:
154  - /names/python-heads/0/first
155  - /names/python-heads/1/first
156  - /names/perl-heads/0/first
157---
158data:
159    task:
160       - name: wake
161         foo: bar
162       - name: eat
163         task:
164            - name: veggies
165            - name: meats
166       - name: sleep
167ypath: //task
168expected:
169  - /task
170  - /task/1/task
171---
172data:
173  - one:
174      name: xxx
175  - two:
176      name: yyy
177  - three:
178      name: zzz
179ypath: /*/one/name|//three/name
180expected:
181 - /0/one/name
182 - /2/three/name
183---
184data:
185  apple: red
186ypath: .|/apple|apple|/|.
187expected:
188 - /
189 - /apple
190---
191data:
192  - one:
193      name: xxx
194  - two:
195      name: yyy
196  - three:
197      name: zzz
198ypath: /*/(one|three)/name
199expected:
200 - /0/one/name
201 - /2/three/name
202---
203data:
204  - one: xxx
205  - two: yyy
206  - one: zzz
207ypath: /*[one]
208expected:
209  - /0
210  - /2
211---
212data:
213 - food: Hamburger
214   calories: 900
215 - food: Fries
216   calories: 650
217 - food: Soft Drink
218   calories: 350
219ypath: //food[.=Fries]
220expected:
221  - /1/food
Note: See TracBrowser for help on using the repository browser.