Skip to content
This repository
Browse code

MINOR Removed unnecessary tests from symfony-yaml dependency (which a…

…lso fixes phpunit binary execution)
  • Loading branch information...
commit eecca9b73ab8a62972adea349b327dc2d78d9dfb 1 parent 37ae36c
Ingo Schommer authored March 14, 2012

Showing 21 changed files with 0 additions and 3,345 deletions. Show diff stats Hide diff stats

  1. 31  thirdparty/symfony-yaml/test/fixtures/YtsAnchorAlias.yml
  2. 178  thirdparty/symfony-yaml/test/fixtures/YtsBasicTests.yml
  3. 52  thirdparty/symfony-yaml/test/fixtures/YtsBlockMapping.yml
  4. 85  thirdparty/symfony-yaml/test/fixtures/YtsDocumentSeparator.yml
  5. 26  thirdparty/symfony-yaml/test/fixtures/YtsErrorTests.yml
  6. 60  thirdparty/symfony-yaml/test/fixtures/YtsFlowCollections.yml
  7. 176  thirdparty/symfony-yaml/test/fixtures/YtsFoldedScalars.yml
  8. 45  thirdparty/symfony-yaml/test/fixtures/YtsNullsAndEmpties.yml
  9. 1,695  thirdparty/symfony-yaml/test/fixtures/YtsSpecificationExamples.yml
  10. 244  thirdparty/symfony-yaml/test/fixtures/YtsTypeTransfers.yml
  11. 16  thirdparty/symfony-yaml/test/fixtures/index.yml
  12. 51  thirdparty/symfony-yaml/test/fixtures/sfComments.yml
  13. 53  thirdparty/symfony-yaml/test/fixtures/sfCompact.yml
  14. 27  thirdparty/symfony-yaml/test/fixtures/sfMergeKey.yml
  15. 11  thirdparty/symfony-yaml/test/fixtures/sfObjects.yml
  16. 33  thirdparty/symfony-yaml/test/fixtures/sfQuotes.yml
  17. 145  thirdparty/symfony-yaml/test/fixtures/sfTests.yml
  18. 27  thirdparty/symfony-yaml/test/prove.php
  19. 152  thirdparty/symfony-yaml/test/sfYamlDumperTest.php
  20. 147  thirdparty/symfony-yaml/test/sfYamlInlineTest.php
  21. 91  thirdparty/symfony-yaml/test/sfYamlParserTest.php
31  thirdparty/symfony-yaml/test/fixtures/YtsAnchorAlias.yml
... ...
@@ -1,31 +0,0 @@
1  
---- %YAML:1.0
2  
-test: Simple Alias Example
3  
-brief: >
4  
-    If you need to refer to the same item of data twice,
5  
-    you can give that item an alias.  The alias is a plain
6  
-    string, starting with an ampersand.  The item may then
7  
-    be referred to by the alias throughout your document
8  
-    by using an asterisk before the name of the alias.
9  
-    This is called an anchor.
10  
-yaml: |
11  
-    - &showell Steve
12  
-    - Clark
13  
-    - Brian
14  
-    - Oren
15  
-    - *showell
16  
-php: |
17  
-    array('Steve', 'Clark', 'Brian', 'Oren', 'Steve')
18  
-
19  
----
20  
-test: Alias of a Mapping
21  
-brief: >
22  
-    An alias can be used on any item of data, including
23  
-    sequences, mappings, and other complex data types.
24  
-yaml: |
25  
-    - &hello
26  
-        Meat: pork
27  
-        Starch: potato
28  
-    - banana
29  
-    - *hello
30  
-php: |
31  
-    array(array('Meat'=>'pork', 'Starch'=>'potato'), 'banana', array('Meat'=>'pork', 'Starch'=>'potato'))
178  thirdparty/symfony-yaml/test/fixtures/YtsBasicTests.yml
... ...
@@ -1,178 +0,0 @@
1  
---- %YAML:1.0
2  
-test: Simple Sequence 
3  
-brief: | 
4  
-    You can specify a list in YAML by placing each 
5  
-    member of the list on a new line with an opening 
6  
-    dash. These lists are called sequences. 
7  
-yaml: | 
8  
-    - apple 
9  
-    - banana 
10  
-    - carrot 
11  
-php: |
12  
-    array('apple', 'banana', 'carrot')
13  
---- 
14  
-test: Nested Sequences 
15  
-brief: | 
16  
-    You can include a sequence within another 
17  
-    sequence by giving the sequence an empty 
18  
-    dash, followed by an indented list. 
19  
-yaml: | 
20  
-    - 
21  
-     - foo 
22  
-     - bar 
23  
-     - baz 
24  
-php: | 
25  
-    array(array('foo', 'bar', 'baz'))
26  
---- 
27  
-test: Mixed Sequences 
28  
-brief: | 
29  
-    Sequences can contain any YAML data, 
30  
-    including strings and other sequences. 
31  
-yaml: | 
32  
-    - apple 
33  
-    - 
34  
-     - foo 
35  
-     - bar 
36  
-     - x123 
37  
-    - banana 
38  
-    - carrot 
39  
-php: | 
40  
-    array('apple', array('foo', 'bar', 'x123'), 'banana', 'carrot')
41  
---- 
42  
-test: Deeply Nested Sequences 
43  
-brief: | 
44  
-    Sequences can be nested even deeper, with each 
45  
-    level of indentation representing a level of 
46  
-    depth. 
47  
-yaml: | 
48  
-    - 
49  
-     - 
50  
-      - uno 
51  
-      - dos 
52  
-php: | 
53  
-    array(array(array('uno', 'dos')))
54  
---- 
55  
-test: Simple Mapping 
56  
-brief: | 
57  
-    You can add a keyed list (also known as a dictionary or 
58  
-    hash) to your document by placing each member of the 
59  
-    list on a new line, with a colon seperating the key 
60  
-    from its value.  In YAML, this type of list is called 
61  
-    a mapping. 
62  
-yaml: | 
63  
-    foo: whatever 
64  
-    bar: stuff 
65  
-php: | 
66  
-    array('foo' => 'whatever', 'bar' => 'stuff')
67  
---- 
68  
-test: Sequence in a Mapping 
69  
-brief: | 
70  
-    A value in a mapping can be a sequence. 
71  
-yaml: | 
72  
-    foo: whatever 
73  
-    bar: 
74  
-     - uno 
75  
-     - dos 
76  
-php: | 
77  
-    array('foo' => 'whatever', 'bar' => array('uno', 'dos'))
78  
---- 
79  
-test: Nested Mappings 
80  
-brief: | 
81  
-    A value in a mapping can be another mapping. 
82  
-yaml: | 
83  
-    foo: whatever 
84  
-    bar: 
85  
-     fruit: apple 
86  
-     name: steve 
87  
-     sport: baseball 
88  
-php: | 
89  
-    array(
90  
-      'foo' => 'whatever',  
91  
-      'bar' => array(
92  
-         'fruit' => 'apple',  
93  
-         'name' => 'steve', 
94  
-         'sport' => 'baseball' 
95  
-       ) 
96  
-    ) 
97  
---- 
98  
-test: Mixed Mapping 
99  
-brief: | 
100  
-    A mapping can contain any assortment 
101  
-    of mappings and sequences as values. 
102  
-yaml: | 
103  
-    foo: whatever 
104  
-    bar: 
105  
-     - 
106  
-       fruit: apple 
107  
-       name: steve 
108  
-       sport: baseball 
109  
-     - more 
110  
-     - 
111  
-       python: rocks 
112  
-       perl: papers 
113  
-       ruby: scissorses 
114  
-php: | 
115  
-    array(
116  
-      'foo' => 'whatever',  
117  
-      'bar' => array( 
118  
-        array( 
119  
-            'fruit' => 'apple',  
120  
-            'name' => 'steve', 
121  
-            'sport' => 'baseball' 
122  
-        ), 
123  
-        'more', 
124  
-        array( 
125  
-            'python' => 'rocks', 
126  
-            'perl' => 'papers', 
127  
-            'ruby' => 'scissorses' 
128  
-        ) 
129  
-      ) 
130  
-    ) 
131  
---- 
132  
-test: Mapping-in-Sequence Shortcut 
133  
-todo: true
134  
-brief: | 
135  
-     If you are adding a mapping to a sequence, you 
136  
-     can place the mapping on the same line as the 
137  
-     dash as a shortcut. 
138  
-yaml: | 
139  
-     - work on YAML.py: 
140  
-        - work on Store 
141  
-php: | 
142  
-    array(array('work on YAML.py' => array('work on Store')))
143  
----
144  
-test: Sequence-in-Mapping Shortcut
145  
-todo: true
146  
-brief: |
147  
-     The dash in a sequence counts as indentation, so
148  
-     you can add a sequence inside of a mapping without
149  
-     needing spaces as indentation.
150  
-yaml: |
151  
-     allow:
152  
-     - 'localhost'
153  
-     - '%.sourceforge.net'
154  
-     - '%.freepan.org'
155  
-php: |
156  
-     array('allow' => array('localhost', '%.sourceforge.net', '%.freepan.org'))
157  
----
158  
-todo: true
159  
-test: Merge key
160  
-brief: |
161  
-     A merge key ('<<') can be used in a mapping to insert other mappings.  If
162  
-     the value associated with the merge key is a mapping, each of its key/value
163  
-     pairs is inserted into the current mapping.
164  
-yaml: |
165  
-     mapping:
166  
-       name: Joe
167  
-       job: Accountant
168  
-       <<:
169  
-         age: 38
170  
-php: |
171  
-     array(
172  
-       'mapping' =>
173  
-       array(
174  
-         'name' => 'Joe',
175  
-         'job' => 'Accountant',
176  
-         'age' => 38
177  
-       )
178  
-     )
52  thirdparty/symfony-yaml/test/fixtures/YtsBlockMapping.yml
... ...
@@ -1,52 +0,0 @@
1  
---- 
2  
-test: One Element Mapping 
3  
-brief: | 
4  
-    A mapping with one key/value pair 
5  
-yaml: | 
6  
-    foo: bar 
7  
-php: | 
8  
-    array('foo' => 'bar')
9  
---- 
10  
-test: Multi Element Mapping 
11  
-brief: | 
12  
-    More than one key/value pair 
13  
-yaml: | 
14  
-    red: baron 
15  
-    white: walls 
16  
-    blue: berries 
17  
-php: | 
18  
-    array(
19  
-     'red' => 'baron', 
20  
-     'white' => 'walls', 
21  
-     'blue' => 'berries', 
22  
-    )
23  
---- 
24  
-test: Values aligned 
25  
-brief: | 
26  
-    Often times human editors of documents will align the values even 
27  
-    though YAML emitters generally don't. 
28  
-yaml: | 
29  
-    red:   baron 
30  
-    white: walls 
31  
-    blue:  berries 
32  
-php: | 
33  
-    array(
34  
-     'red' => 'baron', 
35  
-     'white' => 'walls', 
36  
-     'blue' => 'berries', 
37  
-    )
38  
---- 
39  
-test: Colons aligned 
40  
-brief: | 
41  
-    Spaces can come before the ': ' key/value separator. 
42  
-yaml: | 
43  
-    red   : baron 
44  
-    white : walls 
45  
-    blue  : berries 
46  
-php: | 
47  
-    array(
48  
-     'red' => 'baron', 
49  
-     'white' => 'walls', 
50  
-     'blue' => 'berries', 
51  
-    )
52  
-    
85  thirdparty/symfony-yaml/test/fixtures/YtsDocumentSeparator.yml
... ...
@@ -1,85 +0,0 @@
1  
---- %YAML:1.0 
2  
-test: Trailing Document Separator 
3  
-todo: true
4  
-brief: > 
5  
-    You can separate YAML documents 
6  
-    with a string of three dashes. 
7  
-yaml: |
8  
-    - foo: 1
9  
-      bar: 2
10  
-    ---
11  
-    more: stuff
12  
-python: |
13  
-    [
14  
-        [ { 'foo': 1, 'bar': 2 } ],
15  
-        { 'more': 'stuff' }
16  
-    ]
17  
-ruby: |
18  
-    [ { 'foo' => 1, 'bar' => 2 } ]
19  
-
20  
---- 
21  
-test: Leading Document Separator 
22  
-todo: true
23  
-brief: >
24  
-    You can explicity give an opening 
25  
-    document separator to your YAML stream. 
26  
-yaml: |
27  
-    ---
28  
-    - foo: 1
29  
-      bar: 2
30  
-    ---
31  
-    more: stuff
32  
-python: |
33  
-    [ 
34  
-        [ {'foo': 1, 'bar': 2}], 
35  
-        {'more': 'stuff'} 
36  
-    ]
37  
-ruby: |
38  
-    [ { 'foo' => 1, 'bar' => 2 } ] 
39  
-
40  
---- 
41  
-test: YAML Header 
42  
-todo: true
43  
-brief: > 
44  
-    The opening separator can contain directives 
45  
-    to the YAML parser, such as the version 
46  
-    number. 
47  
-yaml: | 
48  
-    --- %YAML:1.0 
49  
-    foo: 1 
50  
-    bar: 2 
51  
-php: | 
52  
-    array('foo' => 1, 'bar' => 2)
53  
-documents: 1 
54  
- 
55  
---- 
56  
-test: Red Herring Document Separator 
57  
-brief: > 
58  
-    Separators included in blocks or strings 
59  
-    are treated as blocks or strings, as the 
60  
-    document separator should have no indentation 
61  
-    preceding it. 
62  
-yaml: | 
63  
-    foo: |
64  
-        ---
65  
-php: | 
66  
-    array('foo' => "---\n")
67  
- 
68  
---- 
69  
-test: Multiple Document Separators in Block 
70  
-brief: > 
71  
-    This technique allows you to embed other YAML 
72  
-    documents within literal blocks. 
73  
-yaml: | 
74  
-    foo: | 
75  
-        ---
76  
-        foo: bar
77  
-        ---
78  
-        yo: baz
79  
-    bar: | 
80  
-        fooness
81  
-php: | 
82  
-    array( 
83  
-       'foo' => "---\nfoo: bar\n---\nyo: baz\n", 
84  
-       'bar' => "fooness\n" 
85  
-    )
26  thirdparty/symfony-yaml/test/fixtures/YtsErrorTests.yml
... ...
@@ -1,26 +0,0 @@
1  
---- 
2  
-test: Missing value for hash item 
3  
-todo: true
4  
-brief: | 
5  
-    Third item in this hash doesn't have a value 
6  
-yaml: | 
7  
-    okay: value 
8  
-    also okay: ~ 
9  
-    causes error because no value specified 
10  
-    last key: value okay here too 
11  
-python-error: causes error because no value specified 
12  
- 
13  
---- 
14  
-test: Not indenting enough 
15  
-brief: | 
16  
-    There was a bug in PyYaml where it was off by one 
17  
-    in the indentation check.  It was allowing the YAML  
18  
-    below. 
19  
-# This is actually valid YAML now. Someone should tell showell. 
20  
-yaml: | 
21  
-    foo: 
22  
-    firstline: 1 
23  
-    secondline: 2 
24  
-php: |
25  
-  array('foo' => null, 'firstline' => 1, 'secondline' => 2)
26  
-
60  thirdparty/symfony-yaml/test/fixtures/YtsFlowCollections.yml
... ...
@@ -1,60 +0,0 @@
1  
---- 
2  
-test: Simple Inline Array 
3  
-brief: > 
4  
-    Sequences can be contained on a 
5  
-    single line, using the inline syntax. 
6  
-    Separate each entry with commas and 
7  
-    enclose in square brackets. 
8  
-yaml: | 
9  
-    seq: [ a, b, c ] 
10  
-php: | 
11  
-    array('seq' => array('a', 'b', 'c'))
12  
---- 
13  
-test: Simple Inline Hash 
14  
-brief: > 
15  
-    Mapping can also be contained on 
16  
-    a single line, using the inline 
17  
-    syntax.  Each key-value pair is 
18  
-    separated by a colon, with a comma 
19  
-    between each entry in the mapping. 
20  
-    Enclose with curly braces. 
21  
-yaml: | 
22  
-    hash: { name: Steve, foo: bar } 
23  
-php: | 
24  
-    array('hash' => array('name' => 'Steve', 'foo' => 'bar'))
25  
---- 
26  
-test: Multi-line Inline Collections 
27  
-todo: true
28  
-brief: > 
29  
-    Both inline sequences and inline mappings 
30  
-    can span multiple lines, provided that you 
31  
-    indent the additional lines. 
32  
-yaml: | 
33  
-    languages: [ Ruby, 
34  
-                 Perl, 
35  
-                 Python ] 
36  
-    websites: { YAML: yaml.org, 
37  
-                Ruby: ruby-lang.org, 
38  
-                Python: python.org, 
39  
-                Perl: use.perl.org } 
40  
-php: | 
41  
-    array(
42  
-      'languages' => array('Ruby', 'Perl', 'Python'), 
43  
-      'websites' => array(
44  
-        'YAML' => 'yaml.org', 
45  
-        'Ruby' => 'ruby-lang.org', 
46  
-        'Python' => 'python.org', 
47  
-        'Perl' => 'use.perl.org'  
48  
-      )
49  
-    )
50  
---- 
51  
-test: Commas in Values (not in the spec!)
52  
-todo: true
53  
-brief: > 
54  
-    List items in collections are delimited by commas, but  
55  
-    there must be a space after each comma.  This allows you 
56  
-    to add numbers without quoting. 
57  
-yaml: | 
58  
-    attendances: [ 45,123, 70,000, 17,222 ] 
59  
-php: | 
60  
-    array('attendances' => array(45123, 70000, 17222))
176  thirdparty/symfony-yaml/test/fixtures/YtsFoldedScalars.yml
... ...
@@ -1,176 +0,0 @@
1  
---- %YAML:1.0 
2  
-test: Single ending newline 
3  
-brief: > 
4  
-    A pipe character, followed by an indented
5  
-    block of text is treated as a literal
6  
-    block, in which newlines are preserved
7  
-    throughout the block, including the final
8  
-    newline.
9  
-yaml: | 
10  
-    ---
11  
-    this: |
12  
-        Foo
13  
-        Bar
14  
-php: | 
15  
-    array('this' => "Foo\nBar\n")
16  
---- 
17  
-test: The '+' indicator 
18  
-brief: > 
19  
-    The '+' indicator says to keep newlines at the end of text 
20  
-    blocks. 
21  
-yaml: |
22  
-    normal: |
23  
-      extra new lines not kept
24  
-
25  
-    preserving: |+
26  
-      extra new lines are kept
27  
-
28  
-
29  
-    dummy: value
30  
-php: | 
31  
-    array( 
32  
-        'normal' => "extra new lines not kept\n", 
33  
-        'preserving' => "extra new lines are kept\n\n\n", 
34  
-        'dummy' => 'value' 
35  
-    ) 
36  
---- 
37  
-test: Three trailing newlines in literals 
38  
-brief: > 
39  
-    To give you more control over how space 
40  
-    is preserved in text blocks, YAML has 
41  
-    the keep '+' and chomp '-' indicators. 
42  
-    The keep indicator will preserve all 
43  
-    ending newlines, while the chomp indicator 
44  
-    will strip all ending newlines. 
45  
-yaml: |
46  
-    clipped: |
47  
-        This has one newline.
48  
-
49  
-
50  
-
51  
-    same as "clipped" above: "This has one newline.\n"
52  
-
53  
-    stripped: |-
54  
-        This has no newline.
55  
-
56  
-
57  
-
58  
-    same as "stripped" above: "This has no newline."
59  
-
60  
-    kept: |+
61  
-        This has four newlines.
62  
-
63  
-
64  
-
65  
-    same as "kept" above: "This has four newlines.\n\n\n\n"
66  
-php: |
67  
-    array(  
68  
-      'clipped' => "This has one newline.\n", 
69  
-      'same as "clipped" above' => "This has one newline.\n", 
70  
-      'stripped' => 'This has no newline.', 
71  
-      'same as "stripped" above' => 'This has no newline.', 
72  
-      'kept' => "This has four newlines.\n\n\n\n", 
73  
-      'same as "kept" above' => "This has four newlines.\n\n\n\n" 
74  
-    )
75  
---- 
76  
-test: Extra trailing newlines with spaces
77  
-todo: true
78  
-brief: >
79  
-    Normally, only a single newline is kept 
80  
-    from the end of a literal block, unless the 
81  
-    keep '+' character is used in combination 
82  
-    with the pipe.  The following example 
83  
-    will preserve all ending whitespace 
84  
-    since the last line of both literal blocks 
85  
-    contains spaces which extend past the indentation 
86  
-    level. 
87  
-yaml: |
88  
-    ---
89  
-    this: |
90  
-        Foo
91  
-
92  
-          
93  
-    kept: |+
94  
-        Foo
95  
-
96  
-          
97  
-php: | 
98  
-    array('this' => "Foo\n\n  \n",  
99  
-      'kept' => "Foo\n\n  \n" )
100  
- 
101  
---- 
102  
-test: Folded Block in a Sequence 
103  
-brief: > 
104  
-    A greater-then character, followed by an indented 
105  
-    block of text is treated as a folded block, in 
106  
-    which lines of text separated by a single newline 
107  
-    are concatenated as a single line. 
108  
-yaml: | 
109  
-    ---
110  
-    - apple
111  
-    - banana
112  
-    - >
113  
-        can't you see
114  
-        the beauty of yaml?
115  
-        hmm
116  
-    - dog
117  
-php: | 
118  
-    array( 
119  
-        'apple',  
120  
-        'banana',  
121  
-        "can't you see the beauty of yaml? hmm\n", 
122  
-        'dog' 
123  
-    )
124  
---- 
125  
-test: Folded Block as a Mapping Value 
126  
-brief: > 
127  
-    Both literal and folded blocks can be 
128  
-    used in collections, as values in a  
129  
-    sequence or a mapping. 
130  
-yaml: |
131  
-    ---
132  
-    quote: >
133  
-        Mark McGwire's
134  
-        year was crippled
135  
-        by a knee injury.
136  
-    source: espn
137  
-php: |
138  
-    array( 
139  
-        'quote' => "Mark McGwire's year was crippled by a knee injury.\n", 
140  
-        'source' => 'espn' 
141  
-    ) 
142  
---- 
143  
-test: Three trailing newlines in folded blocks 
144  
-brief: > 
145  
-    The keep and chomp indicators can also 
146  
-    be applied to folded blocks. 
147  
-yaml: | 
148  
-    clipped: >
149  
-        This has one newline.
150  
-
151  
-
152  
-
153  
-    same as "clipped" above: "This has one newline.\n" 
154  
- 
155  
-    stripped: >-
156  
-        This has no newline.
157  
-
158  
-
159  
-
160  
-    same as "stripped" above: "This has no newline."
161  
-
162  
-    kept: >+
163  
-        This has four newlines.
164  
-
165  
-
166  
-
167  
-    same as "kept" above: "This has four newlines.\n\n\n\n"
168  
-php: |
169  
-    array(  
170  
-      'clipped' => "This has one newline.\n", 
171  
-      'same as "clipped" above' => "This has one newline.\n", 
172  
-      'stripped' => 'This has no newline.', 
173  
-      'same as "stripped" above' => 'This has no newline.', 
174  
-      'kept' => "This has four newlines.\n\n\n\n", 
175  
-      'same as "kept" above' => "This has four newlines.\n\n\n\n" 
176  
-    )
45  thirdparty/symfony-yaml/test/fixtures/YtsNullsAndEmpties.yml
... ...
@@ -1,45 +0,0 @@
1  
---- %YAML:1.0 
2  
-test: Empty Sequence 
3  
-brief: > 
4  
-    You can represent the empty sequence 
5  
-    with an empty inline sequence. 
6  
-yaml: | 
7  
-    empty: [] 
8  
-php: | 
9  
-    array('empty' => array())
10  
---- 
11  
-test: Empty Mapping 
12  
-brief: > 
13  
-    You can represent the empty mapping 
14  
-    with an empty inline mapping. 
15  
-yaml: | 
16  
-    empty: {} 
17  
-php: | 
18  
-    array('empty' => array())
19  
---- 
20  
-test: Empty Sequence as Entire Document 
21  
-yaml: | 
22  
-    [] 
23  
-php: | 
24  
-    array()
25  
---- 
26  
-test: Empty Mapping as Entire Document 
27  
-yaml: | 
28  
-    {} 
29  
-php: | 
30  
-    array() 
31  
----  
32  
-test: Null as Document 
33  
-yaml: | 
34  
-    ~ 
35  
-php: | 
36  
-    null
37  
---- 
38  
-test: Empty String 
39  
-brief: > 
40  
-    You can represent an empty string 
41  
-    with a pair of quotes. 
42  
-yaml: | 
43  
-    '' 
44  
-php: | 
45  
-    '' 
1,695  thirdparty/symfony-yaml/test/fixtures/YtsSpecificationExamples.yml
... ...
@@ -1,1695 +0,0 @@
1  
---- %YAML:1.0 
2  
-test: Sequence of scalars 
3  
-spec: 2.1
4  
-yaml: | 
5  
-  - Mark McGwire 
6  
-  - Sammy Sosa 
7  
-  - Ken Griffey 
8  
-php: | 
9  
-  array('Mark McGwire', 'Sammy Sosa', 'Ken Griffey')
10  
---- 
11  
-test: Mapping of scalars to scalars 
12  
-spec: 2.2
13  
-yaml: | 
14  
-  hr:  65 
15  
-  avg: 0.278 
16  
-  rbi: 147 
17  
-php: | 
18  
-  array('hr' => 65, 'avg' => 0.278, 'rbi' => 147)
19  
---- 
20  
-test: Mapping of scalars to sequences 
21  
-spec: 2.3
22  
-yaml: | 
23  
-    american: 
24  
-       - Boston Red Sox 
25  
-       - Detroit Tigers 
26  
-       - New York Yankees 
27  
-    national: 
28  
-       - New York Mets 
29  
-       - Chicago Cubs 
30  
-       - Atlanta Braves 
31  
-php: | 
32  
-    array('american' =>  
33  
-        array( 'Boston Red Sox', 'Detroit Tigers',  
34  
-          'New York Yankees' ), 
35  
-      'national' => 
36  
-        array( 'New York Mets', 'Chicago Cubs',  
37  
-          'Atlanta Braves' )
38  
-    ) 
39  
---- 
40  
-test: Sequence of mappings 
41  
-spec: 2.4
42  
-yaml: | 
43  
-    -  
44  
-      name: Mark McGwire 
45  
-      hr:   65 
46  
-      avg:  0.278 
47  
-    -  
48  
-      name: Sammy Sosa 
49  
-      hr:   63 
50  
-      avg:  0.288 
51  
-php: | 
52  
-    array( 
53  
-      array('name' => 'Mark McGwire', 'hr' => 65, 'avg' => 0.278), 
54  
-      array('name' => 'Sammy Sosa', 'hr' => 63, 'avg' => 0.288) 
55  
-    )
56  
---- 
57  
-test: Legacy A5 
58  
-todo: true
59  
-spec: legacy_A5 
60  
-yaml: | 
61  
-    ? 
62  
-        - New York Yankees 
63  
-        - Atlanta Braves 
64  
-    : 
65  
-      - 2001-07-02 
66  
-      - 2001-08-12 
67  
-      - 2001-08-14 
68  
-    ? 
69  
-        - Detroit Tigers 
70  
-        - Chicago Cubs 
71  
-    : 
72  
-      - 2001-07-23 
73  
-perl-busted: > 
74  
-    YAML.pm will be able to emulate this behavior soon. In this regard 
75  
-    it may be somewhat more correct than Python's native behaviour which 
76  
-    can only use tuples as mapping keys. PyYAML will also need to figure 
77  
-    out some clever way to roundtrip structured keys.
78  
-python: | 
79  
-    [ 
80  
-    { 
81  
-        ('New York Yankees', 'Atlanta Braves'): 
82  
-            [yaml.timestamp('2001-07-02'),  
83  
-             yaml.timestamp('2001-08-12'), 
84  
-             yaml.timestamp('2001-08-14')], 
85  
-        ('Detroit Tigers', 'Chicago Cubs'): 
86  
-        [yaml.timestamp('2001-07-23')] 
87  
-    } 
88  
-    ] 
89  
-ruby: | 
90  
-    { 
91  
-      [ 'New York Yankees', 'Atlanta Braves' ] => 
92  
-        [ Date.new( 2001, 7, 2 ), Date.new( 2001, 8, 12 ), Date.new( 2001, 8, 14 ) ], 
93  
-      [ 'Detroit Tigers', 'Chicago Cubs' ] => 
94  
-        [ Date.new( 2001, 7, 23 ) ] 
95  
-    } 
96  
-syck: |
97  
-  struct test_node seq1[] = {
98  
-      { T_STR, 0, "New York Yankees" },
99  
-      { T_STR, 0, "Atlanta Braves" },
100  
-      end_node
101  
-  };
102  
-  struct test_node seq2[] = {
103  
-      { T_STR, 0, "2001-07-02" },
104  
-      { T_STR, 0, "2001-08-12" },
105  
-      { T_STR, 0, "2001-08-14" },
106  
-      end_node
107  
-  };
108  
-  struct test_node seq3[] = {
109  
-      { T_STR, 0, "Detroit Tigers" },
110  
-      { T_STR, 0, "Chicago Cubs" },
111  
-      end_node
112  
-  };
113  
-  struct test_node seq4[] = {
114  
-      { T_STR, 0, "2001-07-23" },
115  
-      end_node
116  
-  };
117  
-  struct test_node map[] = {
118  
-      { T_SEQ, 0, 0, seq1 },
119  
-      { T_SEQ, 0, 0, seq2 },
120  
-      { T_SEQ, 0, 0, seq3 },
121  
-      { T_SEQ, 0, 0, seq4 },
122  
-      end_node
123  
-  };
124  
-  struct test_node stream[] = {
125  
-      { T_MAP, 0, 0, map },
126  
-      end_node
127  
-  };
128  
- 
129  
---- 
130  
-test: Sequence of sequences 
131  
-spec: 2.5
132  
-yaml: | 
133  
-  - [ name         , hr , avg   ] 
134  
-  - [ Mark McGwire , 65 , 0.278 ] 
135  
-  - [ Sammy Sosa   , 63 , 0.288 ] 
136  
-php: | 
137  
-  array( 
138  
-    array( 'name', 'hr', 'avg' ), 
139  
-    array( 'Mark McGwire', 65, 0.278 ), 
140  
-    array( 'Sammy Sosa', 63, 0.288 ) 
141  
-  )
142  
---- 
143  
-test: Mapping of mappings 
144  
-todo: true
145  
-spec: 2.6
146  
-yaml: | 
147  
-  Mark McGwire: {hr: 65, avg: 0.278}
148  
-  Sammy Sosa: {
149  
-      hr: 63,
150  
-      avg: 0.288
151  
-    }
152  
-php: | 
153  
-  array(  
154  
-    'Mark McGwire' => 
155  
-      array( 'hr' => 65, 'avg' => 0.278 ), 
156  
-    'Sammy Sosa' => 
157  
-      array( 'hr' => 63, 'avg' => 0.288 ) 
158  
-  )
159  
---- 
160  
-test: Two documents in a stream each with a leading comment
161  
-todo: true
162  
-spec: 2.7 
163  
-yaml: | 
164  
-  # Ranking of 1998 home runs
165  
-  ---
166  
-  - Mark McGwire
167  
-  - Sammy Sosa
168  
-  - Ken Griffey
169  
-  
170  
-  # Team ranking
171  
-  ---
172  
-  - Chicago Cubs
173  
-  - St Louis Cardinals
174  
-ruby: | 
175  
-  y = YAML::Stream.new 
176  
-  y.add( [ 'Mark McGwire', 'Sammy Sosa', 'Ken Griffey' ] ) 
177  
-  y.add( [ 'Chicago Cubs', 'St Louis Cardinals' ] ) 
178  
-documents: 2 
179  
- 
180  
---- 
181  
-test: Play by play feed from a game
182  
-todo: true
183  
-spec: 2.8
184  
-yaml: | 
185  
-  ---
186  
-  time: 20:03:20
187  
-  player: Sammy Sosa
188  
-  action: strike (miss)
189  
-  ...
190  
-  ---
191  
-  time: 20:03:47
192  
-  player: Sammy Sosa
193  
-  action: grand slam
194  
-  ...
195  
-perl: | 
196  
-  [ 'Mark McGwire', 'Sammy Sosa', 'Ken Griffey' ] 
197  
-documents: 2 
198  
- 
199  
---- 
200  
-test: Single document with two comments 
201  
-spec: 2.9
202  
-yaml: | 
203  
-  hr: # 1998 hr ranking 
204  
-    - Mark McGwire 
205  
-    - Sammy Sosa 
206  
-  rbi: 
207  
-    # 1998 rbi ranking 
208  
-    - Sammy Sosa 
209  
-    - Ken Griffey 
210  
-php: | 
211  
-  array(  
212  
-    'hr' => array( 'Mark McGwire', 'Sammy Sosa' ), 
213  
-    'rbi' => array( 'Sammy Sosa', 'Ken Griffey' )  
214  
-  )
215  
---- 
216  
-test: Node for Sammy Sosa appears twice in this document 
217  
-spec: 2.10 
218  
-yaml: | 
219  
-   ---
220  
-   hr: 
221  
-      - Mark McGwire 
222  
-      # Following node labeled SS 
223  
-      - &SS Sammy Sosa 
224  
-   rbi: 
225  
-      - *SS # Subsequent occurance 
226  
-      - Ken Griffey 
227  
-php: | 
228  
-   array(
229  
-      'hr' =>
230  
-         array('Mark McGwire', 'Sammy Sosa'),
231  
-      'rbi' =>
232  
-         array('Sammy Sosa', 'Ken Griffey')
233  
-   )
234  
---- 
235  
-test: Mapping between sequences 
236  
-todo: true
237  
-spec: 2.11
238  
-yaml: | 
239  
-   ? # PLAY SCHEDULE 
240  
-     - Detroit Tigers 
241  
-     - Chicago Cubs 
242  
-   :   
243  
-     - 2001-07-23 
244  
-   
245  
-   ? [ New York Yankees, 
246  
-       Atlanta Braves ] 
247  
-   : [ 2001-07-02, 2001-08-12,  
248  
-       2001-08-14 ] 
249  
-ruby: | 
250  
-   {  
251  
-      [ 'Detroit Tigers', 'Chicago Cubs' ] => [ Date.new( 2001, 7, 23 ) ], 
252  
-      [ 'New York Yankees', 'Atlanta Braves' ] => [ Date.new( 2001, 7, 2 ), Date.new( 2001, 8, 12 ), Date.new( 2001, 8, 14 ) ] 
253  
-   } 
254  
-syck: |
255  
-  struct test_node seq1[] = {
256  
-      { T_STR, 0, "New York Yankees" },
257  
-      { T_STR, 0, "Atlanta Braves" },
258  
-      end_node
259  
-  };
260  
-  struct test_node seq2[] = {
261  
-      { T_STR, 0, "2001-07-02" },
262  
-      { T_STR, 0, "2001-08-12" },
263  
-      { T_STR, 0, "2001-08-14" },
264  
-      end_node
265  
-  };
266  
-  struct test_node seq3[] = {
267  
-      { T_STR, 0, "Detroit Tigers" },
268  
-      { T_STR, 0, "Chicago Cubs" },
269  
-      end_node
270  
-  };
271  
-  struct test_node seq4[] = {
272  
-      { T_STR, 0, "2001-07-23" },
273  
-      end_node
274  
-  };
275  
-  struct test_node map[] = {
276  
-      { T_SEQ, 0, 0, seq3 },
277  
-      { T_SEQ, 0, 0, seq4 },
278  
-      { T_SEQ, 0, 0, seq1 },
279  
-      { T_SEQ, 0, 0, seq2 },
280  
-      end_node
281  
-  };
282  
-  struct test_node stream[] = {
283  
-      { T_MAP, 0, 0, map },
284  
-      end_node
285  
-  };
286  
- 
287  
---- 
288  
-test: Sequence key shortcut 
289  
-spec: 2.12
290  
-yaml: | 
291  
-  ---
292  
-  # products purchased
293  
-  - item    : Super Hoop
294  
-    quantity: 1
295  
-  - item    : Basketball
296  
-    quantity: 4
297  
-  - item    : Big Shoes
298  
-    quantity: 1
299  
-php: | 
300  
-  array (
301  
-    array (
302  
-      'item' => 'Super Hoop',
303  
-      'quantity' => 1,
304  
-    ),
305  
-    array (
306  
-      'item' => 'Basketball',
307  
-      'quantity' => 4,
308  
-    ),
309  
-    array (
310  
-      'item' => 'Big Shoes',
311  
-      'quantity' => 1,
312  
-    )
313  
-  )
314  
-perl: | 
315  
-  [  
316  
-     { item => 'Super Hoop', quantity => 1 }, 
317  
-     { item => 'Basketball', quantity => 4 }, 
318  
-     { item => 'Big Shoes',  quantity => 1 }  
319  
-  ]  
320  
-   
321  
-ruby: | 
322  
-  [  
323  
-     { 'item' => 'Super Hoop', 'quantity' => 1 }, 
324  
-     { 'item' => 'Basketball', 'quantity' => 4 }, 
325  
-     { 'item' => 'Big Shoes', 'quantity' => 1 }  
326  
-  ]  
327  
-python: | 
328  
-  [ 
329  
-       { 'item': 'Super Hoop', 'quantity': 1 }, 
330  
-       { 'item': 'Basketball', 'quantity': 4 }, 
331  
-       { 'item': 'Big Shoes',  'quantity': 1 }  
332  
-  ] 
333  
-syck: |
334  
-  struct test_node map1[] = {
335  
-      { T_STR, 0, "item" },
336  
-          { T_STR, 0, "Super Hoop" },
337  
-      { T_STR, 0, "quantity" },
338  
-          { T_STR, 0, "1" },
339  
-      end_node
340  
-  };
341  
-  struct test_node map2[] = {
342  
-      { T_STR, 0, "item" },
343  
-          { T_STR, 0, "Basketball" },
344  
-      { T_STR, 0, "quantity" },
345  
-          { T_STR, 0, "4" },
346  
-      end_node
347  
-  };
348  
-  struct test_node map3[] = {
349  
-      { T_STR, 0, "item" },
350  
-          { T_STR, 0, "Big Shoes" },
351  
-      { T_STR, 0, "quantity" },
352  
-          { T_STR, 0, "1" },
353  
-      end_node
354  
-  };
355  
-  struct test_node seq[] = {
356  
-      { T_MAP, 0, 0, map1 },
357  
-      { T_MAP, 0, 0, map2 },
358  
-      { T_MAP, 0, 0, map3 },
359  
-      end_node
360  
-  };