• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1const EX2_1 : &'static str =
2    "- Mark McGwire\n- Sammy Sosa\n- Ken Griffey";
3
4const EX2_2 : &'static str =
5    "hr:  65    # Home runs\navg: 0.278 # Batting average\nrbi: 147   # Runs Batted In";
6
7const EX2_3 : &'static str =
8    "american:\n- Boston Red Sox\n- Detroit Tigers\n- New York Yankees\nnational:\n- New York Mets\n- Chicago Cubs\n- Atlanta Braves";
9
10const EX2_4 : &'static str =
11    "-\n  name: Mark McGwire\n  hr:   65\n  avg:  0.278\n-\n  name: Sammy Sosa\n  hr:   63\n  avg:  0.288";
12
13const EX2_5 : &'static str =
14    "- [name        , hr, avg  ]\n- [Mark McGwire, 65, 0.278]\n- [Sammy Sosa  , 63, 0.288]";
15
16const EX2_6 : &'static str =
17    "Mark McGwire: {hr: 65, avg: 0.278}\nSammy Sosa: {\n    hr: 63,\n    avg: 0.288\n  }";
18
19const EX2_7 : &'static str =
20    "# Ranking of 1998 home runs\n---\n- Mark McGwire\n- Sammy Sosa\n- Ken Griffey\n\n# Team ranking\n---\n- Chicago Cubs\n- St Louis Cardinals";
21
22const EX2_8 : &'static str =
23    "---\ntime: 20:03:20\nplayer: Sammy Sosa\naction: strike (miss)\n...\n---\ntime: 20:03:47\nplayer: Sammy Sosa\naction: grand slam\n...";
24
25const EX2_9 : &'static str =
26    "---\nhr: # 1998 hr ranking\n  - Mark McGwire\n  - Sammy Sosa\nrbi:\n  # 1998 rbi ranking\n  - Sammy Sosa\n  - Ken Griffey";
27
28const EX2_10 : &'static str =
29    "---\nhr:\n  - Mark McGwire\n  # Following node labeled SS\n  - &SS Sammy Sosa\nrbi:\n  - *SS # Subsequent occurrence\n  - Ken Griffey";
30
31const EX2_11 : &'static str =
32    "? - Detroit Tigers\n  - Chicago cubs\n:\n  - 2001-07-23\n\n? [ New York Yankees,\n    Atlanta Braves ]\n: [ 2001-07-02, 2001-08-12,\n    2001-08-14 ]";
33
34const EX2_12 : &'static str =
35    "---\n# Products purchased\n- item    : Super Hoop\n  quantity: 1\n- item    : Basketball\n  quantity: 4\n- item    : Big Shoes\n  quantity: 1";
36
37const EX2_13 : &'static str =
38    "# ASCII Art\n--- |\n  \\//||\\/||\n  // ||  ||__";
39
40const EX2_14 : &'static str =
41    "--- >\n  Mark McGwire's\n  year was crippled\n  by a knee injury.";
42
43const EX2_15 : &'static str =
44    ">\n Sammy Sosa completed another\n fine season with great stats.\n \n   63 Home Runs\n   0.288 Batting Average\n \n What a year!";
45
46const EX2_16 : &'static str =
47    "name: Mark McGwire\naccomplishment: >\n  Mark set a major league\n  home run record in 1998.\nstats: |\n  65 Home Runs\n  0.278 Batting Average\n";
48
49const EX2_17 : &'static str =
50    "unicode: \"Sosa did fine.\\u263A\"\ncontrol: \"\\b1998\\t1999\\t2000\\n\"\nhex esc: \"\\x0d\\x0a is \\r\\n\"\n\nsingle: '\"Howdy!\" he cried.'\nquoted: ' # Not a ''comment''.'\ntie-fighter: '|\\-*-/|'";
51
52const EX2_18 : &'static str =
53    "plain:\n  This unquoted scalar\n  spans many lines.\n\nquoted: \"So does this\n  quoted scalar.\\n\"";
54
55// TODO: 2.19 - 2.22 schema tags
56
57const EX2_23 : &'static str =
58    "---\nnot-date: !!str 2002-04-28\n\npicture: !!binary |\n R0lGODlhDAAMAIQAAP//9/X\n 17unp5WZmZgAAAOfn515eXv\n Pz7Y6OjuDg4J+fn5OTk6enp\n 56enmleECcgggoBADs=\n\napplication specific tag: !something |\n The semantics of the tag\n above may be different for\n different documents.";
59
60const EX2_24 : &'static str =
61    "%TAG ! tag:clarkevans.com,2002:\n--- !shape\n  # Use the ! handle for presenting\n  # tag:clarkevans.com,2002:circle\n- !circle\n  center: &ORIGIN {x: 73, y: 129}\n  radius: 7\n- !line\n  start: *ORIGIN\n  finish: { x: 89, y: 102 }\n- !label\n  start: *ORIGIN\n  color: 0xFFEEBB\n  text: Pretty vector drawing.";
62
63const EX2_25 : &'static str =
64    "# Sets are represented as a\n# Mapping where each key is\n# associated with a null value\n--- !!set\n? Mark McGwire\n? Sammy Sosa\n? Ken Griffey";
65
66const EX2_26 : &'static str =
67    "# Ordered maps are represented as\n# A sequence of mappings, with\n# each mapping having one key\n--- !!omap\n- Mark McGwire: 65\n- Sammy Sosa: 63\n- Ken Griffey: 58";
68
69const EX2_27 : &'static str =
70    "--- !<tag:clarkevans.com,2002:invoice>\ninvoice: 34843\ndate   : 2001-01-23\nbill-to: &id001\n    given  : Chris\n    family : Dumars\n    address:\n        lines: |\n            458 Walkman Dr.\n            Suite #292\n        city    : Royal Oak\n        state   : MI\n        postal  : 48046\nship-to: *id001\nproduct:\n    - sku         : BL394D\n      quantity    : 4\n      description : Basketball\n      price       : 450.00\n    - sku         : BL4438H\n      quantity    : 1\n      description : Super Hoop\n      price       : 2392.00\ntax  : 251.42\ntotal: 4443.52\ncomments:\n    Late afternoon is best.\n    Backup contact is Nancy\n    Billsmer @ 338-4338.";
71
72const EX2_28 : &'static str =
73    "---\nTime: 2001-11-23 15:01:42 -5\nUser: ed\nWarning:\n  This is an error message\n  for the log file\n---\nTime: 2001-11-23 15:02:31 -5\nUser: ed\nWarning:\n  A slightly different error\n  message.\n---\nDate: 2001-11-23 15:03:17 -5\nUser: ed\nFatal:\n  Unknown variable \"bar\"\nStack:\n  - file: TopClass.py\n    line: 23\n    code: |\n      x = MoreObject(\"345\\n\")\n  - file: MoreClass.py\n    line: 58\n    code: |-\n      foo = bar";
74
75// TODO: 5.1 - 5.2 BOM
76
77const EX5_3 : &'static str =
78    "sequence:\n- one\n- two\nmapping:\n  ? sky\n  : blue\n  sea : green";
79
80const EX5_4 : &'static str =
81    "sequence: [ one, two, ]\nmapping: { sky: blue, sea: green }";
82
83const EX5_5 : &'static str = "# Comment only.";
84
85const EX5_6 : &'static str =
86    "anchored: !local &anchor value\nalias: *anchor";
87
88const EX5_7 : &'static str =
89    "literal: |\n  some\n  text\nfolded: >\n  some\n  text\n";
90
91const EX5_8 : &'static str =
92    "single: 'text'\ndouble: \"text\"";
93
94// TODO: 5.9 directive
95// TODO: 5.10 reserved indicator
96
97const EX5_11 : &'static str =
98    "|\n  Line break (no glyph)\n  Line break (glyphed)\n";
99
100const EX5_12 : &'static str =
101    "# Tabs and spaces\nquoted: \"Quoted\t\"\nblock:	|\n  void main() {\n  \tprintf(\"Hello, world!\\n\");\n  }";
102
103const EX5_13 : &'static str =
104    "\"Fun with \\\\\n\\\" \\a \\b \\e \\f \\\n\\n \\r \\t \\v \\0 \\\n\\  \\_ \\N \\L \\P \\\n\\x41 \\u0041 \\U00000041\"";
105
106const EX5_14 : &'static str =
107    "Bad escapes:\n  \"\\c\n  \\xq-\"";
108
109const EX6_1 : &'static str =
110    "  # Leading comment line spaces are\n   # neither content nor indentation.\n    \nNot indented:\n By one space: |\n    By four\n      spaces\n Flow style: [    # Leading spaces\n   By two,        # in flow style\n  Also by two,    # are neither\n  \tStill by two   # content nor\n    ]             # indentation.";
111
112const EX6_2 : &'static str =
113    "? a\n: -\tb\n  -  -\tc\n     - d";
114
115const EX6_3 : &'static str =
116    "- foo:\t bar\n- - baz\n  -\tbaz";
117
118const EX6_4 : &'static str =
119    "plain: text\n  lines\nquoted: \"text\n  \tlines\"\nblock: |\n  text\n   \tlines\n";
120
121const EX6_5 : &'static str =
122    "Folding:\n  \"Empty line\n   \t\n  as a line feed\"\nChomping: |\n  Clipped empty lines\n ";
123
124const EX6_6 : &'static str =
125    ">-\n  trimmed\n  \n \n\n  as\n  space";
126
127const EX6_7 : &'static str =
128    ">\n  foo \n \n  \t bar\n\n  baz\n";
129
130const EX6_8 : &'static str =
131    "\"\n  foo \n \n  \t bar\n\n  baz\n\"";
132
133const EX6_9 : &'static str =
134    "key:    # Comment\n  value";
135
136const EX6_10 : &'static str =
137    "  # Comment\n   \n\n";
138
139const EX6_11 : &'static str =
140    "key:    # Comment\n        # lines\n  value\n\n";
141
142const EX6_12 : &'static str =
143    "{ first: Sammy, last: Sosa }:\n# Statistics:\n  hr:  # Home runs\n     65\n  avg: # Average\n   0.278";
144
145const EX6_13 : &'static str =
146    "%FOO  bar baz # Should be ignored\n               # with a warning.\n--- \"foo\"";
147
148const EX6_14 : &'static str =
149    "%YAML 1.3 # Attempt parsing\n           # with a warning\n---\n\"foo\"";
150
151const EX6_15 : &'static str =
152    "%YAML 1.2\n%YAML 1.1\nfoo";
153
154const EX6_16 : &'static str =
155    "%TAG !yaml! tag:yaml.org,2002:\n---\n!yaml!str \"foo\"";
156
157const EX6_17 : &'static str =
158    "%TAG ! !foo\n%TAG ! !foo\nbar";
159
160const EX6_18 : &'static str =
161    "# Private\n!foo \"bar\"\n...\n# Global\n%TAG ! tag:example.com,2000:app/\n---\n!foo \"bar\"";
162
163const EX6_19 : &'static str =
164    "%TAG !! tag:example.com,2000:app/\n---\n!!int 1 - 3 # Interval, not integer";
165
166const EX6_20 : &'static str =
167    "%TAG !e! tag:example.com,2000:app/\n---\n!e!foo \"bar\"";
168
169const EX6_21 : &'static str =
170    "%TAG !m! !my-\n--- # Bulb here\n!m!light fluorescent\n...\n%TAG !m! !my-\n--- # Color here\n!m!light green";
171
172const EX6_22 : &'static str =
173    "%TAG !e! tag:example.com,2000:app/\n---\n- !e!foo \"bar\"";
174
175const EX6_23 : &'static str =
176    "!!str &a1 \"foo\":\n  !!str bar\n&a2 baz : *a1";
177
178const EX6_24 : &'static str =
179    "!<tag:yaml.org,2002:str> foo :\n  !<!bar> baz";
180
181const EX6_25 : &'static str =
182    "- !<!> foo\n- !<$:?> bar\n";
183
184const EX6_26 : &'static str =
185    "%TAG !e! tag:example.com,2000:app/\n---\n- !local foo\n- !!str bar\n- !e!tag%21 baz\n";
186
187const EX6_27a : &'static str =
188    "%TAG !e! tag:example,2000:app/\n---\n- !e! foo";
189
190const EX6_27b : &'static str =
191    "%TAG !e! tag:example,2000:app/\n---\n- !h!bar baz";
192
193const EX6_28 : &'static str =
194    "# Assuming conventional resolution:\n- \"12\"\n- 12\n- ! 12";
195
196const EX6_29 : &'static str =
197    "First occurrence: &anchor Value\nSecond occurrence: *anchor";
198
199const EX7_1 : &'static str =
200    "First occurrence: &anchor Foo\nSecond occurrence: *anchor\nOverride anchor: &anchor Bar\nReuse anchor: *anchor";
201
202const EX7_2 : &'static str =
203    "{\n  foo : !!str,\n  !!str : bar,\n}";
204
205const EX7_3 : &'static str =
206    "{\n  ? foo :,\n  : bar,\n}\n";
207
208const EX7_4 : &'static str =
209    "\"implicit block key\" : [\n  \"implicit flow key\" : value,\n ]";
210
211const EX7_5 : &'static str =
212    "\"folded \nto a space,\t\n \nto a line feed, or \t\\\n \\ \tnon-content\"";
213
214const EX7_6 : &'static str =
215    "\" 1st non-empty\n\n 2nd non-empty \n\t3rd non-empty \"";
216
217const EX7_7 : &'static str = " 'here''s to \"quotes\"'";
218
219const EX7_8 : &'static str =
220    "'implicit block key' : [\n  'implicit flow key' : value,\n ]";
221
222const EX7_9 : &'static str =
223    "' 1st non-empty\n\n 2nd non-empty \n\t3rd non-empty '";
224
225const EX7_10 : &'static str =
226    "# Outside flow collection:\n- ::vector\n- \": - ()\"\n- Up, up, and away!\n- -123\n- http://example.com/foo#bar\n# Inside flow collection:\n- [ ::vector,\n  \": - ()\",\n  \"Up, up, and away!\",\n  -123,\n  http://example.com/foo#bar ]";
227
228const EX7_11 : &'static str =
229    "implicit block key : [\n  implicit flow key : value,\n ]";
230
231const EX7_12 : &'static str =
232    "1st non-empty\n\n 2nd non-empty \n\t3rd non-empty";
233
234const EX7_13 : &'static str =
235    "- [ one, two, ]\n- [three ,four]";
236
237const EX7_14 : &'static str =
238    "[\n\"double\n quoted\", 'single\n           quoted',\nplain\n text, [ nested ],\nsingle: pair,\n]";
239
240const EX7_15 : &'static str =
241    "- { one : two , three: four , }\n- {five: six,seven : eight}";
242
243const EX7_16 : &'static str =
244    "{\n? explicit: entry,\nimplicit: entry,\n?\n}";
245
246const EX7_17 : &'static str =
247    "{\nunquoted : \"separate\",\nhttp://foo.com,\nomitted value:,\n: omitted key,\n}";
248
249const EX7_18 : &'static str =
250    "{\n\"adjacent\":value,\n\"readable\":value,\n\"empty\":\n}";
251
252const EX7_19 : &'static str =
253    "[\nfoo: bar\n]";
254
255const EX7_20 : &'static str =
256    "[\n? foo\n bar : baz\n]";
257
258const EX7_21 : &'static str =
259    "- [ YAML : separate ]\n- [ : empty key entry ]\n- [ {JSON: like}:adjacent ]";
260
261const EX7_22 : &'static str =
262    "[ foo\n bar: invalid,";  // Note: we don't check (on purpose) the >1K chars for an
263                       // implicit key
264
265const EX7_23 : &'static str =
266    "- [ a, b ]\n- { a: b }\n- \"a\"\n- 'b'\n- c";
267
268const EX7_24 : &'static str =
269    "- !!str \"a\"\n- 'b'\n- &anchor \"c\"\n- *anchor\n- !!str";
270
271const EX8_1 : &'static str =
272    "- | # Empty header\n literal\n- >1 # Indentation indicator\n  folded\n- |+ # Chomping indicator\n keep\n\n- >1- # Both indicators\n  strip\n";
273
274const EX8_2 : &'static str =
275    "- |\n detected\n- >\n \n  \n  # detected\n- |1\n  explicit\n- >\n \t\n detected\n";
276
277const EX8_3a : &'static str =
278    "- |\n  \n text";
279
280const EX8_3b : &'static str =
281    "- >\n  text\n text";
282
283const EX8_3c : &'static str =
284    "- |2\n text";
285
286const EX8_4 : &'static str =
287    "strip: |-\n  text\nclip: |\n  text\nkeep: |+\n  text\n";
288
289const EX8_5 : &'static str =
290    " # Strip\n  # Comments:\nstrip: |-\n  # text\n  \n # Clip\n  # comments:\n\nclip: |\n  # text\n \n # Keep\n  # comments:\n\nkeep: |+\n  # text\n\n # Trail\n  # Comments\n";
291
292const EX8_6 : &'static str =
293    "strip: >-\n\nclip: >\n\nkeep: |+\n\n";
294
295const EX8_7 : &'static str =
296    "|\n literal\n \ttext\n\n";
297
298const EX8_8 : &'static str =
299    "|\n \n  \n  literal\n   \n  \n  text\n\n # Comment\n";
300
301const EX8_9 : &'static str =
302    ">\n folded\n text\n\n";
303
304const EX8_10 : &'static str =
305    ">\n\n folded\n line\n\n next\n line\n   * bullet\n\n   * list\n   * lines\n\n last\n line\n\n# Comment\n";
306
307const EX8_11 : &'static str = EX8_10;
308const EX8_12 : &'static str = EX8_10;
309const EX8_13 : &'static str = EX8_10;
310
311const EX8_14 : &'static str =
312    "block sequence:\n  - one\n  - two : three\n";
313
314const EX8_15 : &'static str =
315    "- # Empty\n- |\n block node\n- - one # Compact\n  - two # sequence\n- one: two # Compact mapping\n";
316
317const EX8_16 : &'static str =
318    "block mapping:\n key: value\n";
319
320const EX8_17 : &'static str =
321    "? explicit key # Empty value\n? |\n  block key\n: - one # Explicit compact\n  - two # block value\n";
322
323// XXX libyaml failed this test
324const EX8_18 : &'static str =
325    "plain key: in-line value\n:  # Both empty\n\"quoted key\":\n- entry\n";
326
327const EX8_19 : &'static str =
328    "- sun: yellow\n- ? earth: blue\n  : moon: white\n";
329
330const EX8_20 : &'static str =
331    "-\n  \"flow in block\"\n- >\n Block scalar\n- !!map # Block collection\n  foo : bar\n";
332
333const EX8_21 : &'static str =
334    "literal: |2\n  value\nfolded:\n   !foo\n  >1\n value\n";
335
336const EX8_22 : &'static str =
337    "sequence: !!seq\n- entry\n- !!seq\n - nested\nmapping: !!map\n foo: bar\n";
338