# YAML Test Matrix

--- &test-PUW8
  Title: Document start on last line
  Tags: [ header ]

YAML

---
a: b
---

Expected Events

+STR
+DOC ---
+MAP
=VAL :a
=VAL :b
-MAP
-DOC
+DOC ---
=VAL :
-DOC
-STR

Expected JSON

{
"a": "b"
}
null

c-libfyaml-event

 ok

c-libyaml-event

 ok

cpp-rapidyaml-event

 ok

cpp-yamlcpp-event

 ok

dotnet-yamldotnet-event

 ok

hs-hsyaml-event

 ok

js-yaml-event

 ok

nim-nimyaml-event

 ok

perl-pp-event

 ok

perl-refparser-event

 ok

py-pyyaml-event

 ok

py-ruamel-event

 ok

rust-yamlrust-event

 ok

c-libfyaml-json

 json_ok

go-yaml-json

 json_ok

hs-hsyaml-json

 json_ok

js-jsyaml-json

 json_ok

js-yaml-json

 json_ok

perl-pp-json

 json_ok

perl-pplibyaml-json

 json_ok

perl-syck-json

 json_ok

perl-tiny-json

 json_ok

perl-xs-json

 json_ok

perl-yaml-json

 json_ok

py-pyyaml-json

 json_ok

py-ruamel-json

 json_ok

ruby-psych-json

 json_ok

lua-lyaml-json

 json_diff
{
  "a": "b"
}
{}

dotnet-yamldotnet-json

 error
Unhandled exception. YamlDotNet.Core.YamlException: (Line: 3, Col: 1, Idx: 9) - (Line: 3, Col: 4, Idx: 12): Expected 'StreamEnd', got 'DocumentStart' (at Line: 3, Col: 1, Idx: 9).
   at YamlDotNet.Core.ParserExtensions.Require[T](IParser parser)
   at YamlDotNet.Core.ParserExtensions.Consume[T](IParser parser)
   at YamlDotNet.Serialization.Deserializer.Deserialize(IParser parser, Type type)
   at YamlDotNet.Serialization.Deserializer.Deserialize(TextReader input, Type type)
   at YamlDotNet.Serialization.Deserializer.Deserialize(TextReader input)
   at Program.Main(String[] commandLineArguments)
Aborted (core dumped)

hs-reference-yeast

 na
Line  Col Char Byte Token|Content
   1    0    0    0 +DOC |
   1    0    0    0 =HEAD|---
   1    3    3    3 +NODE|
   1    3    3    3 =EOL |\x0a
   2    0    4    4 +MAP |
   2    0    4    4 +PAIR|
   2    0    4    4 +NODE|
   2    0    4    4 +VAL |
   2    0    4    4 =TEXT|a
   2    1    5    5 -VAL |
   2    1    5    5 -NODE|
   2    1    5    5 =SYNX|:
   2    2    6    6 =WSPC|.
   2    3    7    7 +NODE|
   2    3    7    7 +VAL |
   2    3    7    7 =TEXT|b
   2    4    8    8 -VAL |
   2    4    8    8 -NODE|
   2    4    8    8 =EOL |\x0a
   3    0    9    9 -PAIR|
   3    0    9    9 -MAP |
   3    0    9    9 -NODE|
   3    0    9    9 -DOC |
   3    0    9    9 +DOC |
   3    0    9    9 =HEAD|---
   3    3   12   12 +NODE|
   3    3   12   12 +VAL |
   3    3   12   12 -VAL |
   3    3   12   12 -NODE|
   3    3   12   12 =EOL |\x0a
   4    0   13   13 -DOC |

perl-pp-perl

 na
{
  'a' => 'b'
}
undef

perl-pplibyaml-perl

 na
{
  'a' => 'b'
}
undef

perl-syck-perl

 na
{
  'a' => 'b'
}
undef

perl-tiny-perl

 na
{
  'a' => 'b'
}
undef

perl-xs-perl

 na
{
  'a' => 'b'
}
undef

perl-yaml-perl

 na
{
  'a' => 'b'
}
undef

py-pyyaml-py

 na
{'a': 'b'}
None

py-ruamel-py

 na
{'a': 'b'}
None