# 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

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

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-xs-json

 json_ok

py-pyyaml-json

 json_ok

py-ruamel-json

 json_ok

ruby-psych-json

 json_ok

cpp-rapidyaml-event

 diff
Minimal Events:
+STR
+DOC
+MAP
=VAL :Mapping
=VAL :Document
-MAP
-DOC
+DOC ---
=VAL :
-DOC ...
+DOC ---
+MAP
=VAL :matches %
=VAL :20
-MAP
-DOC
-STR
Transformed Events:
+STR
+DOC ---
+MAP
=VAL :Mapping
=VAL :Document
-MAP
-DOC
+DOC ---
=VAL :
-DOC
+DOC ---
+MAP
=VAL :matches %
=VAL :20
-MAP
-DOC
-STR
Got Events:
+STR
+DOC ---
+MAP
=VAL :Mapping
=VAL :Document
-MAP
-DOC
+DOC ---
=VAL :
-DOC
+DOC ---
+MAP
=VAL :matches %
=VAL :20
-MAP
-DOC
-STR

lua-lyaml-json

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

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.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)

go-yaml-json

 error
{"Mapping":"Document"}
null
yaml: line 4: found incompatible YAML document

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.

hs-reference-yeast

 na
Line  Col Char Byte Token|Content
   1    0    0    0 +DOC |
   1    0    0    0 +NODE|
   1    0    0    0 +MAP |
   1    0    0    0 +PAIR|
   1    0    0    0 +NODE|
   1    0    0    0 +VAL |
   1    0    0    0 =TEXT|Mapping
   1    7    7    7 -VAL |
   1    7    7    7 -NODE|
   1    7    7    7 =SYNX|:
   1    8    8    8 =WSPC|.
   1    9    9    9 +NODE|
   1    9    9    9 +VAL |
   1    9    9    9 =TEXT|Document
   1   17   17   17 -VAL |
   1   17   17   17 -NODE|
   1   17   17   17 =EOL |\x0a
   2    0   18   18 -PAIR|
   2    0   18   18 -MAP |
   2    0   18   18 -NODE|
   2    0   18   18 -DOC |
   2    0   18   18 +DOC |
   2    0   18   18 =HEAD|---
   2    3   21   21 +NODE|
   2    3   21   21 +VAL |
   2    3   21   21 -VAL |
   2    3   21   21 -NODE|
   2    3   21   21 =EOL |\x0a
   3    0   22   22 +COMM|
   3    0   22   22 =SYNX|#
   3    1   23   23 =META|.Empty
   3    7   29   29 -COMM|
   3    7   29   29 =EOL |\x0a
   4    0   30   30 -DOC |
   4    0   30   30 =FOOT|...
   4    3   33   33 =EOL |\x0a
   5    0   34   34 +DOC |
   5    0   34   34 +DIR |
   5    0   34   34 =SYNX|%
   5    1   35   35 =META|YAML
   5    5   39   39 =WSPC|.
   5    6   40   40 =META|1.2
   5    9   43   43 -DIR |
   5    9   43   43 =EOL |\x0a
   6    0   44   44 =HEAD|---
   6    3   47   47 +NODE|
   6    3   47   47 =EOL |\x0a
   7    0   48   48 +MAP |
   7    0   48   48 +PAIR|
   7    0   48   48 +NODE|
   7    0   48   48 +VAL |
   7    0   48   48 =TEXT|matches.%
   7    9   57   57 -VAL |
   7    9   57   57 -NODE|
   7    9   57   57 =SYNX|:
   7   10   58   58 =WSPC|.
   7   11   59   59 +NODE|
   7   11   59   59 +VAL |
   7   11   59   59 =TEXT|20
   7   13   61   61 -VAL |
   7   13   61   61 -NODE|
   7   13   61   61 =EOL |\x0a
   8    0   62   62 -PAIR|
   8    0   62   62 -MAP |
   8    0   62   62 -NODE|
   8    0   62   62 -DOC |

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}