This repository has been archived on 2023-08-20. You can view files and clone it, but cannot push or open issues or pull requests.
symfony/tests/Symfony/Tests/Component/Yaml/Fixtures/YtsDocumentSeparator.yml

86 lines
1.5 KiB
YAML
Raw Normal View History

2011-06-08 18:56:59 +01:00
--- %YAML:1.0
test: Trailing Document Separator
2010-01-04 14:26:20 +00:00
todo: true
2011-06-08 18:56:59 +01:00
brief: >
You can separate YAML documents
with a string of three dashes.
2010-01-04 14:26:20 +00:00
yaml: |
- foo: 1
bar: 2
---
more: stuff
python: |
[
[ { 'foo': 1, 'bar': 2 } ],
{ 'more': 'stuff' }
]
ruby: |
[ { 'foo' => 1, 'bar' => 2 } ]
2011-06-08 18:56:59 +01:00
---
test: Leading Document Separator
2010-01-04 14:26:20 +00:00
todo: true
brief: >
2011-06-08 18:56:59 +01:00
You can explicity give an opening
document separator to your YAML stream.
2010-01-04 14:26:20 +00:00
yaml: |
---
- foo: 1
bar: 2
---
more: stuff
python: |
2011-06-08 18:56:59 +01:00
[
[ {'foo': 1, 'bar': 2}],
{'more': 'stuff'}
2010-01-04 14:26:20 +00:00
]
ruby: |
2011-06-08 18:56:59 +01:00
[ { 'foo' => 1, 'bar' => 2 } ]
2010-01-04 14:26:20 +00:00
2011-06-08 18:56:59 +01:00
---
test: YAML Header
2010-01-04 14:26:20 +00:00
todo: true
2011-06-08 18:56:59 +01:00
brief: >
The opening separator can contain directives
to the YAML parser, such as the version
number.
yaml: |
--- %YAML:1.0
foo: 1
bar: 2
php: |
2010-01-04 14:26:20 +00:00
array('foo' => 1, 'bar' => 2)
2011-06-08 18:56:59 +01:00
documents: 1
---
test: Red Herring Document Separator
brief: >
Separators included in blocks or strings
are treated as blocks or strings, as the
document separator should have no indentation
preceding it.
yaml: |
2010-01-04 14:26:20 +00:00
foo: |
---
2011-06-08 18:56:59 +01:00
php: |
2010-01-04 14:26:20 +00:00
array('foo' => "---\n")
2011-06-08 18:56:59 +01:00
---
test: Multiple Document Separators in Block
brief: >
This technique allows you to embed other YAML
documents within literal blocks.
yaml: |
foo: |
2010-01-04 14:26:20 +00:00
---
foo: bar
---
yo: baz
2011-06-08 18:56:59 +01:00
bar: |
2010-01-04 14:26:20 +00:00
fooness
2011-06-08 18:56:59 +01:00
php: |
array(
'foo' => "---\nfoo: bar\n---\nyo: baz\n",
'bar' => "fooness\n"
2010-01-04 14:26:20 +00:00
)