# 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
}

cpp-event

 ok

hs-yaml-event

 ok

java-event

 ok

js-event

 ok

nimyaml-event

 ok

perl5-pp-event

 ok

pyyaml-event

 ok

ruamel-event

 ok

hs-yaml-json

 json_ok

java-json

 json_ok

js-json

 json_ok

js-yaml-json

 json_ok

perl5-pp-json

 json_ok

pyyaml-json

 json_ok

ruamel-json

 json_ok

perl5-syck-json

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

perl5-tiny-json

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

libyaml-event

 error
+STR
+DOC
+MAP
=VAL :Mapping
=VAL :Document
-MAP
-DOC
+DOC ---
=VAL :
-DOC ...
Parse error: found incompatible YAML document

luajit-json

 error
luajit: found incompatible YAML document at document: 2, line: 5, column: 1

stack traceback:
	[C]: in function 'load'
	/bin/luajit-json:6: in main chunk
	[C]: at 0x004044a0

perl5-pegex-event

 error
Maximum parsing rules reached (1000)

perl5-pm-json

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

perl5-pm-pl

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

perl5-xs-json

 error
YAML::XS::Load Error: The problem:

    found incompatible YAML document

was found at document: 3, line: 5, column: 1

perl5-xs-pl

 error
YAML::XS::Load Error: The problem:

    found incompatible YAML document

was found at document: 3, line: 5, column: 1

ruby-json

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

perl5-pp-pl

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

perl5-syck-pl

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

perl5-tiny-pl

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

pyyaml-py

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

ruamel-py

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