The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.
#####################################################################
# Support for YAML version directives

# Simple inline case (comment variant)
=== simple_doctype_comment
--- yaml
--- #YAML:1.0
foo: bar
--- perl
[ { foo => 'bar' } ]
--- nosyck


# Simple inline case (percent variant)
=== simple_doctype_percent
--- yaml
--- %YAML:1.0
foo: bar
--- perl
[ { foo => 'bar' } ]
--- noyamlpm
--- noxs


# Simple header (comment variant)
=== predocument_1_0
--- yaml
\%YAML:1.0
---
foo: bar
--- perl
[ { foo => 'bar' } ]
--- noyamlpm
--- nosyck
--- noxs


# Simple inline case (comment variant)
=== predocument_1_1
--- yaml
\%YAML 1.1
---
foo: bar
--- perl
[ { foo => 'bar' } ]
--- noyamlpm
--- nosyck


# Multiple inline documents (comment variant)
=== multi_doctype_comment
--- yaml
--- #YAML:1.0
foo: bar
--- #YAML:1.0
- 1
--- #YAML:1.0
foo: bar
--- perl
[ { foo => 'bar' }, [ 1 ], { foo => 'bar' } ]


# Simple pre-document case (comment variant)
=== predocument_percent
--- yaml
\%YAML 1.1
---
foo: bar
--- perl
[ { foo => 'bar' } ]
--- noyamlpm
--- nosyck


# Simple pre-document case (comment variant)
=== predocument_comment
--- yaml
\#YAML 1.1
---
foo: bar
--- perl
[ { foo => 'bar' } ]


=== two documents
--- yaml
\---
- foo
\---
- bar
--- perl
[ [ 'foo' ], [ 'bar' ] ]

# Document ending (hash)
=== document_end_hash
--- yaml
---
  foo: bar
...
--- perl
[ { foo => "bar" } ]
--- noyamlpm
--- nosyck


# Document ending (array)
=== document_end_array
--- yaml
---
- foo
...
--- perl
[ [ 'foo' ] ]
--- noyamlpm


# Multiple documents (simple)
=== multi_document_simple
--- yaml
---
- foo
...
---
- foo
...
--- perl
[ [ 'foo' ], [ 'foo' ] ]
--- noyamlpm


# Multiple documents (whitespace-separated)
=== multi_document_space
--- yaml
---
- foo
...

---
- foo
...
--- perl
[ [ 'foo' ], [ 'foo' ] ]
--- noyamlpm

#####################################################################
# Sample Testing

# Test a completely empty document
=== empty
--- yaml
--- perl
[ ]


# Just a newline
### YAML.pm has a bug where it dies on a single newline
=== only_newlines
--- yaml
\
\
--- perl
[ ]


# Just a comment
=== only_comment
--- yaml
\# comment
--- perl
[ ]


# Empty documents
=== only_header
--- yaml
---

--- perl
[ undef ]


=== two_header
--- yaml
---
---

--- perl
[ undef, undef ]


=== one_undef
--- yaml
--- ~

--- perl
[ undef ]


=== one_undef2
--- yaml
---  ~
--- perl
[ undef ]


=== two_undef
--- yaml
--- ~
---

--- perl
[ undef, undef ]