| 1 |
##################################################################### |
| 2 |
# Support for YAML version directives |
| 3 |
|
| 4 |
# Simple inline case (comment variant) |
| 5 |
=== simple_doctype_comment |
| 6 |
--- yaml |
| 7 |
--- #YAML:1.0 |
| 8 |
foo: bar |
| 9 |
--- perl |
| 10 |
[ { foo => 'bar' } ] |
| 11 |
--- nosyck |
| 12 |
|
| 13 |
|
| 14 |
# Simple inline case (percent variant) |
| 15 |
=== simple_doctype_percent |
| 16 |
--- yaml |
| 17 |
--- %YAML:1.0 |
| 18 |
foo: bar |
| 19 |
--- perl |
| 20 |
[ { foo => 'bar' } ] |
| 21 |
--- noyamlpm |
| 22 |
--- noxs |
| 23 |
|
| 24 |
|
| 25 |
# Simple header (comment variant) |
| 26 |
=== predocument_1_0 |
| 27 |
--- yaml |
| 28 |
\%YAML:1.0 |
| 29 |
--- |
| 30 |
foo: bar |
| 31 |
--- perl |
| 32 |
[ { foo => 'bar' } ] |
| 33 |
--- noyamlpm |
| 34 |
--- nosyck |
| 35 |
--- noxs |
| 36 |
|
| 37 |
|
| 38 |
# Simple inline case (comment variant) |
| 39 |
=== predocument_1_1 |
| 40 |
--- yaml |
| 41 |
\%YAML 1.1 |
| 42 |
--- |
| 43 |
foo: bar |
| 44 |
--- perl |
| 45 |
[ { foo => 'bar' } ] |
| 46 |
--- noyamlpm |
| 47 |
--- nosyck |
| 48 |
|
| 49 |
|
| 50 |
# Multiple inline documents (comment variant) |
| 51 |
=== multi_doctype_comment |
| 52 |
--- yaml |
| 53 |
--- #YAML:1.0 |
| 54 |
foo: bar |
| 55 |
--- #YAML:1.0 |
| 56 |
- 1 |
| 57 |
--- #YAML:1.0 |
| 58 |
foo: bar |
| 59 |
--- perl |
| 60 |
[ { foo => 'bar' }, [ 1 ], { foo => 'bar' } ] |
| 61 |
|
| 62 |
|
| 63 |
# Simple pre-document case (comment variant) |
| 64 |
=== predocument_percent |
| 65 |
--- yaml |
| 66 |
\%YAML 1.1 |
| 67 |
--- |
| 68 |
foo: bar |
| 69 |
--- perl |
| 70 |
[ { foo => 'bar' } ] |
| 71 |
--- noyamlpm |
| 72 |
--- nosyck |
| 73 |
|
| 74 |
|
| 75 |
# Simple pre-document case (comment variant) |
| 76 |
=== predocument_comment |
| 77 |
--- yaml |
| 78 |
\#YAML 1.1 |
| 79 |
--- |
| 80 |
foo: bar |
| 81 |
--- perl |
| 82 |
[ { foo => 'bar' } ] |
| 83 |
|
| 84 |
|
| 85 |
=== two documents |
| 86 |
--- yaml |
| 87 |
\--- |
| 88 |
- foo |
| 89 |
\--- |
| 90 |
- bar |
| 91 |
--- perl |
| 92 |
[ [ 'foo' ], [ 'bar' ] ] |
| 93 |
|
| 94 |
# Document ending (hash) |
| 95 |
=== document_end_hash |
| 96 |
--- yaml |
| 97 |
--- |
| 98 |
foo: bar |
| 99 |
... |
| 100 |
--- perl |
| 101 |
[ { foo => "bar" } ] |
| 102 |
--- noyamlpm |
| 103 |
--- nosyck |
| 104 |
|
| 105 |
|
| 106 |
# Document ending (array) |
| 107 |
=== document_end_array |
| 108 |
--- yaml |
| 109 |
--- |
| 110 |
- foo |
| 111 |
... |
| 112 |
--- perl |
| 113 |
[ [ 'foo' ] ] |
| 114 |
--- noyamlpm |
| 115 |
|
| 116 |
|
| 117 |
# Multiple documents (simple) |
| 118 |
=== multi_document_simple |
| 119 |
--- yaml |
| 120 |
--- |
| 121 |
- foo |
| 122 |
... |
| 123 |
--- |
| 124 |
- foo |
| 125 |
... |
| 126 |
--- perl |
| 127 |
[ [ 'foo' ], [ 'foo' ] ] |
| 128 |
--- noyamlpm |
| 129 |
|
| 130 |
|
| 131 |
# Multiple documents (whitespace-separated) |
| 132 |
=== multi_document_space |
| 133 |
--- yaml |
| 134 |
--- |
| 135 |
- foo |
| 136 |
... |
| 137 |
|
| 138 |
--- |
| 139 |
- foo |
| 140 |
... |
| 141 |
--- perl |
| 142 |
[ [ 'foo' ], [ 'foo' ] ] |
| 143 |
--- noyamlpm |
| 144 |
|
| 145 |
##################################################################### |
| 146 |
# Sample Testing |
| 147 |
|
| 148 |
# Test a completely empty document |
| 149 |
=== empty |
| 150 |
--- yaml |
| 151 |
--- perl |
| 152 |
[ ] |
| 153 |
|
| 154 |
|
| 155 |
# Just a newline |
| 156 |
### YAML.pm has a bug where it dies on a single newline |
| 157 |
=== only_newlines |
| 158 |
--- yaml |
| 159 |
\ |
| 160 |
\ |
| 161 |
--- perl |
| 162 |
[ ] |
| 163 |
|
| 164 |
|
| 165 |
# Just a comment |
| 166 |
=== only_comment |
| 167 |
--- yaml |
| 168 |
\# comment |
| 169 |
--- perl |
| 170 |
[ ] |
| 171 |
|
| 172 |
|
| 173 |
# Empty documents |
| 174 |
=== only_header |
| 175 |
--- yaml |
| 176 |
--- |
| 177 |
|
| 178 |
--- perl |
| 179 |
[ undef ] |
| 180 |
|
| 181 |
|
| 182 |
=== two_header |
| 183 |
--- yaml |
| 184 |
--- |
| 185 |
--- |
| 186 |
|
| 187 |
--- perl |
| 188 |
[ undef, undef ] |
| 189 |
|
| 190 |
|
| 191 |
=== one_undef |
| 192 |
--- yaml |
| 193 |
--- ~ |
| 194 |
|
| 195 |
--- perl |
| 196 |
[ undef ] |
| 197 |
|
| 198 |
|
| 199 |
=== one_undef2 |
| 200 |
--- yaml |
| 201 |
--- ~ |
| 202 |
--- perl |
| 203 |
[ undef ] |
| 204 |
|
| 205 |
|
| 206 |
=== two_undef |
| 207 |
--- yaml |
| 208 |
--- ~ |
| 209 |
--- |
| 210 |
|
| 211 |
--- perl |
| 212 |
[ undef, undef ] |
| 213 |
|
| 214 |
|