# YAML Test Matrix

--- &test-9DXL
  Title: Spec Example 9.6. Stream [1.3]
  Tags: [ 1.3-mod, header, spec ]

YAML

Mapping: Document
---
# Empty
...
%YAML 1.2
---
matches %: 20

Expected Events

+STR
+DOC
+MAP
=VAL :Mapping
=VAL :Document
-MAP
-DOC
+DOC ---
=VAL :
-DOC ...
+DOC ---
+MAP
=VAL :matches %
=VAL :20
-MAP
-DOC
-STR

Expected JSON

{
"Mapping": "Document"
}
null
{
"matches %": 20
}

c-libfyaml-event

 ok

c-libyaml-event

 ok

cpp-yamlcpp-event

 ok

dotnet-yamldotnet-event

 ok

hs-hsyaml-event

 ok

java-snakeyaml-event

 ok

js-yaml-event

 ok

nim-nimyaml-event

 ok

perl-pp-event

 ok

perl-pplibyaml-event

 ok

py-pyyaml-event

 ok

py-ruamel-event

 ok

c-libfyaml-json

 json_ok

hs-hsyaml-json

 json_ok

java-snakeyaml-json

 json_ok

js-jsyaml-json

 json_ok

js-yaml-json

 json_ok

perl-pp-json

 json_ok

perl-pplibyaml-json

 json_ok

perl-xs-json

 json_ok

py-pyyaml-json

 json_ok

py-ruamel-json

 json_ok

perl-syck-json

 json_diff
{
  "Mapping": "Document"
}
null
"%YAML 1.2"
{
  "matches %": 20
}

perl-tiny-json

 json_diff
{
  "Mapping": "Document"
}
null
{
  "matches %": "20"
}

dotnet-yamldotnet-json

 error
Unhandled exception. YamlDotNet.Core.YamlException: (Line: 2, Col: 1, Idx: 18) - (Line: 2, Col: 4, Idx: 21): Expected 'StreamEnd', got 'DocumentStart' (at Line: 2, Col: 1, Idx: 18).
   at YamlDotNet.Core.ParserExtensions.Expect[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)

lua-lyaml-json

 error
luajit: 4:1: found incompatible YAML document
stack traceback:
	[C]: in function 'error'
	/usr/local/share/lua/5.1/lyaml/init.lua:291: in function 'error'
	/usr/local/share/lua/5.1/lyaml/init.lua:310: in function 'parse'
	/usr/local/share/lua/5.1/lyaml/init.lua:481: in function 'load'
	/yaml/bin/lua-lyaml-json:6: in main chunk
	[C]: at 0x5594589bbf97

perl-yaml-json

 error
YAML Error: Expected separator '---'
   Code: YAML_PARSE_ERR_NO_SEPARATOR
   Line: 4
   Document: 3
 at /perl5/lib/perl5/YAML/Loader.pm line 88.

perl-yaml-perl

 error
YAML Error: Expected separator '---'
   Code: YAML_PARSE_ERR_NO_SEPARATOR
   Line: 4
   Document: 3
 at /perl5/lib/perl5/YAML/Loader.pm line 88.

ruby-psych-json

 error
/usr/lib/ruby/2.5.0/psych.rb:405:in `parse': (<unknown>): found incompatible YAML document at line 1 column 1 (Psych::SyntaxError)
	from /usr/lib/ruby/2.5.0/psych.rb:405:in `parse_stream'
	from /usr/lib/ruby/2.5.0/psych.rb:488:in `load_stream'
	from /yaml/bin/ruby-psych-json:6:in `<main>'

perl-pp-perl

 na
{
  'Mapping' => 'Document'
}
undef
{
  'matches %' => 20
}

perl-pplibyaml-perl

 na
{
  'Mapping' => 'Document'
}
undef
{
  'matches %' => 20
}

perl-syck-perl

 na
{
  'Mapping' => 'Document'
}
undef
'%YAML 1.2'
{
  'matches %' => 20
}

perl-tiny-perl

 na
{
  'Mapping' => 'Document'
}
undef
{
  'matches %' => '20'
}

perl-xs-perl

 na
{
  'Mapping' => 'Document'
}
undef
{
  'matches %' => 20
}

py-pyyaml-py

 na
{'Mapping': 'Document'}
None
{'matches %': 20}

py-ruamel-py

 na
{'Mapping': 'Document'}
None
{'matches %': 20}