# YAML Test Matrix

--- &test-6ZKB
  Title: Spec Example 9.6. Stream
  Tags: [ 1.3-err, header, spec ]

YAML

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

Expected Events

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

Expected JSON

"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
=VAL :Document
-DOC
+DOC ---
=VAL :
-DOC ...
+DOC ---
+MAP
=VAL :matches %
=VAL :20
-MAP
-DOC
-STR
Transformed Events:
+STR
+DOC ---
=VAL :Document
-DOC
+DOC ---
=VAL :
-DOC
+DOC ---
+MAP
=VAL :matches %
=VAL :20
-MAP
-DOC
-STR
Got Events:
+STR
+DOC ---
=VAL :Document
-DOC
+DOC ---
=VAL :
-DOC
+DOC ---
+MAP
=VAL :matches %
=VAL :20
-MAP
-DOC
-STR

lua-lyaml-json

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

perl-syck-json

 json_diff
{
  "Document --- # Empty ... %YAML 1.2 --- matches %": 20
}

dotnet-yamldotnet-json

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

go-yaml-json

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

perl-tiny-json

 error
YAML::Tiny failed to classify line 'Document' at /yaml/bin/perl-tiny-json line 12.

perl-tiny-perl

 error
YAML::Tiny failed to classify line 'Document' at /yaml/bin/perl-tiny-perl line 15.

perl-yaml-json

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

perl-yaml-perl

 error
YAML Error: Expected separator '---'
   Code: YAML_PARSE_ERR_NO_SEPARATOR
   Line: 1
   Document: 2
 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 +VAL |
   1    0    0    0 =TEXT|Document
   1    8    8    8 -VAL |
   1    8    8    8 -NODE|
   1    8    8    8 =EOL |\x0a
   2    0    9    9 -DOC |
   2    0    9    9 +DOC |
   2    0    9    9 =HEAD|---
   2    3   12   12 +NODE|
   2    3   12   12 +VAL |
   2    3   12   12 -VAL |
   2    3   12   12 -NODE|
   2    3   12   12 =EOL |\x0a
   3    0   13   13 +COMM|
   3    0   13   13 =SYNX|#
   3    1   14   14 =META|.Empty
   3    7   20   20 -COMM|
   3    7   20   20 =EOL |\x0a
   4    0   21   21 -DOC |
   4    0   21   21 =FOOT|...
   4    3   24   24 =EOL |\x0a
   5    0   25   25 +DOC |
   5    0   25   25 +DIR |
   5    0   25   25 =SYNX|%
   5    1   26   26 =META|YAML
   5    5   30   30 =WSPC|.
   5    6   31   31 =META|1.2
   5    9   34   34 -DIR |
   5    9   34   34 =EOL |\x0a
   6    0   35   35 =HEAD|---
   6    3   38   38 +NODE|
   6    3   38   38 =EOL |\x0a
   7    0   39   39 +MAP |
   7    0   39   39 +PAIR|
   7    0   39   39 +NODE|
   7    0   39   39 +VAL |
   7    0   39   39 =TEXT|matches.%
   7    9   48   48 -VAL |
   7    9   48   48 -NODE|
   7    9   48   48 =SYNX|:
   7   10   49   49 =WSPC|.
   7   11   50   50 +NODE|
   7   11   50   50 +VAL |
   7   11   50   50 =TEXT|20
   7   13   52   52 -VAL |
   7   13   52   52 -NODE|
   7   13   52   52 =EOL |\x0a
   8    0   53   53 -PAIR|
   8    0   53   53 -MAP |
   8    0   53   53 -NODE|
   8    0   53   53 -DOC |

perl-pp-perl

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

perl-pplibyaml-perl

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

perl-syck-perl

 na
{
  'Document --- # Empty ... %YAML 1.2 --- matches %' => 20
}

perl-xs-perl

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

py-pyyaml-py

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

py-ruamel-py

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