# YAML Test Matrix

--- &test-35KP
  Title: Tags for Root Objects
  Tags: [ explicit-key, header, mapping, tag ]

YAML

--- !!map
? a
: b
--- !!seq
- !!str c
--- !!str
d
e

Expected Events

+STR
+DOC ---
+MAP <tag:yaml.org,2002:map>
=VAL :a
=VAL :b
-MAP
-DOC
+DOC ---
+SEQ <tag:yaml.org,2002:seq>
=VAL <tag:yaml.org,2002:str> :c
-SEQ
-DOC
+DOC ---
=VAL <tag:yaml.org,2002:str> :d e
-DOC
-STR

Expected JSON

{
"a": "b"
}
[
"c"
]
"d e"

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

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

lua-lyaml-json

 json_ok

perl-pp-json

 json_ok

perl-pplibyaml-json

 json_ok

perl-syck-json

 json_ok

perl-xs-json

 json_ok

py-pyyaml-json

 json_ok

py-ruamel-json

 json_ok

ruby-psych-json

 json_ok

rust-yamlrust-event

 diff
Minimal Events:
+STR
+DOC
+MAP <tag:yaml.org,2002:map>
=VAL :a
=VAL :b
-MAP
-DOC
+DOC
+SEQ <tag:yaml.org,2002:seq>
=VAL <tag:yaml.org,2002:str> :c
-SEQ
-DOC
+DOC
=VAL <tag:yaml.org,2002:str> :d e
-DOC
-STR
Transformed Events:
+STR
+DOC
+MAP
=VAL :a
=VAL :b
-MAP
-DOC
+DOC
+SEQ
=VAL <tag:yaml.org,2002:str> :c
-SEQ
-DOC
+DOC
=VAL <tag:yaml.org,2002:str> :d e
-DOC
-STR
Got Events:
+STR
+DOC
+MAP
=VAL :a
=VAL :b
-MAP
-DOC
+DOC
+SEQ
=VAL <tag:yaml.org,2002:str> :c
-SEQ
-DOC
+DOC
=VAL <tag:yaml.org,2002:str> :d e
-DOC
-STR

dotnet-yamldotnet-json

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

perl-yaml-json

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

perl-yaml-perl

 error
YAML Error: Expected separator '---'
   Code: YAML_PARSE_ERR_NO_SEPARATOR
   Line: 7
   Document: 4
 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 =HEAD|---
   1    3    3    3 +NODE|
   1    3    3    3 =WSPC|.
   1    4    4    4 +PROP|
   1    4    4    4 +TAG |
   1    4    4    4 +HAND|
   1    4    4    4 =SYNX|!
   1    5    5    5 =SYNX|!
   1    6    6    6 -HAND|
   1    6    6    6 =META|map
   1    9    9    9 -TAG |
   1    9    9    9 -PROP|
   1    9    9    9 =EOL |\x0a
   2    0   10   10 +MAP |
   2    0   10   10 +PAIR|
   2    0   10   10 =SYNX|?
   2    1   11   11 =WSPC|.
   2    2   12   12 +NODE|
   2    2   12   12 +VAL |
   2    2   12   12 =TEXT|a
   2    3   13   13 -VAL |
   2    3   13   13 -NODE|
   2    3   13   13 =EOL |\x0a
   3    0   14   14 =SYNX|:
   3    1   15   15 =WSPC|.
   3    2   16   16 +NODE|
   3    2   16   16 +VAL |
   3    2   16   16 =TEXT|b
   3    3   17   17 -VAL |
   3    3   17   17 -NODE|
   3    3   17   17 =EOL |\x0a
   4    0   18   18 -PAIR|
   4    0   18   18 -MAP |
   4    0   18   18 -NODE|
   4    0   18   18 -DOC |
   4    0   18   18 +DOC |
   4    0   18   18 =HEAD|---
   4    3   21   21 +NODE|
   4    3   21   21 =WSPC|.
   4    4   22   22 +PROP|
   4    4   22   22 +TAG |
   4    4   22   22 +HAND|
   4    4   22   22 =SYNX|!
   4    5   23   23 =SYNX|!
   4    6   24   24 -HAND|
   4    6   24   24 =META|seq
   4    9   27   27 -TAG |
   4    9   27   27 -PROP|
   4    9   27   27 =EOL |\x0a
   5    0   28   28 +SEQ |
   5    0   28   28 =SYNX|-
   5    1   29   29 =WSPC|.
   5    2   30   30 +NODE|
   5    2   30   30 +PROP|
   5    2   30   30 +TAG |
   5    2   30   30 +HAND|
   5    2   30   30 =SYNX|!
   5    3   31   31 =SYNX|!
   5    4   32   32 -HAND|
   5    4   32   32 =META|str
   5    7   35   35 -TAG |
   5    7   35   35 -PROP|
   5    7   35   35 =WSPC|.
   5    8   36   36 +VAL |
   5    8   36   36 =TEXT|c
   5    9   37   37 -VAL |
   5    9   37   37 -NODE|
   5    9   37   37 =EOL |\x0a
   6    0   38   38 -SEQ |
   6    0   38   38 -NODE|
   6    0   38   38 -DOC |
   6    0   38   38 +DOC |
   6    0   38   38 =HEAD|---
   6    3   41   41 =WSPC|.
   6    4   42   42 +NODE|
   6    4   42   42 +PROP|
   6    4   42   42 +TAG |
   6    4   42   42 +HAND|
   6    4   42   42 =SYNX|!
   6    5   43   43 =SYNX|!
   6    6   44   44 -HAND|
   6    6   44   44 =META|str
   6    9   47   47 -TAG |
   6    9   47   47 -PROP|
   6    9   47   47 =EOL |\x0a
   7    0   48   48 +VAL |
   7    0   48   48 =TEXT|d
   7    1   49   49 =FOLD|\x0a
   8    0   50   50 =TEXT|e
   8    1   51   51 -VAL |
   8    1   51   51 -NODE|
   8    1   51   51 =EOL |\x0a
   9    0   52   52 -DOC |

perl-pp-perl

 na
{
  'a' => 'b'
}
[
  'c'
]
'd e'

perl-pplibyaml-perl

 na
{
  'a' => 'b'
}
[
  'c'
]
'd e'

perl-syck-perl

 na
{
  'a' => 'b'
}
[
  'c'
]
'd e'

perl-xs-perl

 na
{
  'a' => 'b'
}
[
  'c'
]
'd e'

py-pyyaml-py

 na
{'a': 'b'}
['c']
'd e'

py-ruamel-py

 na
{'a': 'b'}
['c']
'd e'

perl-tiny-json

 ni
YAML::Tiny does not support a feature in line '!!map' at /yaml/bin/perl-tiny-json line 12.

perl-tiny-perl

 ni
YAML::Tiny does not support a feature in line '!!map' at /yaml/bin/perl-tiny-perl line 15.