# YAML Test Matrix

--- &test-6JWB
  Title: Tags for Block Objects
  Tags: [ mapping, sequence, tag ]

YAML

foo: !!seq
  - !!str a
  - !!map
    key: !!str value

Expected Events

+STR
+DOC
+MAP
=VAL :foo
+SEQ <tag:yaml.org,2002:seq>
=VAL <tag:yaml.org,2002:str> :a
+MAP <tag:yaml.org,2002:map>
=VAL :key
=VAL <tag:yaml.org,2002:str> :value
-MAP
-SEQ
-MAP
-DOC
-STR

Expected JSON

{
"foo": [
"a",
{
"key": "value"
}
]
}

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

perl-yaml-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
=VAL :foo
+SEQ <tag:yaml.org,2002:seq>
=VAL <tag:yaml.org,2002:str> :a
+MAP <tag:yaml.org,2002:map>
=VAL :key
=VAL <tag:yaml.org,2002:str> :value
-MAP
-SEQ
-MAP
-DOC
-STR
Transformed Events:
+STR
+DOC
+MAP
=VAL :foo
+SEQ
=VAL <tag:yaml.org,2002:str> :a
+MAP
=VAL :key
=VAL <tag:yaml.org,2002:str> :value
-MAP
-SEQ
-MAP
-DOC
-STR
Got Events:
+STR
+DOC
+MAP
=VAL :foo
+SEQ
=VAL <tag:yaml.org,2002:str> :a
+MAP
=VAL :key
=VAL <tag:yaml.org,2002:str> :value
-MAP
-SEQ
-MAP
-DOC
-STR

dotnet-yamldotnet-json

 error
Unhandled exception. YamlDotNet.Core.YamlException: (Line: 1, Col: 6, Idx: 5) - (Line: 2, Col: 3, Idx: 13): Encountered an unresolved tag 'tag:yaml.org,2002:seq'
   at YamlDotNet.Serialization.NodeTypeResolvers.PreventUnknownTagsNodeTypeResolver.YamlDotNet.Serialization.INodeTypeResolver.Resolve(NodeEvent nodeEvent, Type& currentType)
   at YamlDotNet.Serialization.ValueDeserializers.NodeValueDeserializer.GetTypeFromEvent(NodeEvent nodeEvent, Type currentType)
   at YamlDotNet.Serialization.ValueDeserializers.NodeValueDeserializer.DeserializeValue(IParser parser, Type expectedType, SerializerState state, IValueDeserializer nestedObjectDeserializer)
   at YamlDotNet.Serialization.ValueDeserializers.AliasValueDeserializer.DeserializeValue(IParser parser, Type expectedType, SerializerState state, IValueDeserializer nestedObjectDeserializer)
   at YamlDotNet.Serialization.ValueDeserializers.NodeValueDeserializer.<>c__DisplayClass3_0.<DeserializeValue>b__0(IParser r, Type t)
   at YamlDotNet.Serialization.NodeDeserializers.DictionaryNodeDeserializer.DeserializeHelper(Type tKey, Type tValue, IParser parser, Func`3 nestedObjectDeserializer, IDictionary result)
   at YamlDotNet.Serialization.NodeDeserializers.DictionaryNodeDeserializer.YamlDotNet.Serialization.INodeDeserializer.Deserialize(IParser parser, Type expectedType, Func`3 nestedObjectDeserializer, Object& value)
   at YamlDotNet.Serialization.ValueDeserializers.NodeValueDeserializer.DeserializeValue(IParser parser, Type expectedType, SerializerState state, IValueDeserializer nestedObjectDeserializer)
   at YamlDotNet.Serialization.ValueDeserializers.AliasValueDeserializer.DeserializeValue(IParser parser, Type expectedType, SerializerState state, IValueDeserializer nestedObjectDeserializer)
   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)

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|foo
   1    3    3    3 -VAL |
   1    3    3    3 -NODE|
   1    3    3    3 =SYNX|:
   1    4    4    4 +NODE|
   1    4    4    4 =WSPC|.
   1    5    5    5 +PROP|
   1    5    5    5 +TAG |
   1    5    5    5 +HAND|
   1    5    5    5 =SYNX|!
   1    6    6    6 =SYNX|!
   1    7    7    7 -HAND|
   1    7    7    7 =META|seq
   1   10   10   10 -TAG |
   1   10   10   10 -PROP|
   1   10   10   10 =EOL |\x0a
   2    0   11   11 +SEQ |
   2    0   11   11 =DENT|..
   2    2   13   13 =SYNX|-
   2    3   14   14 =WSPC|.
   2    4   15   15 +NODE|
   2    4   15   15 +PROP|
   2    4   15   15 +TAG |
   2    4   15   15 +HAND|
   2    4   15   15 =SYNX|!
   2    5   16   16 =SYNX|!
   2    6   17   17 -HAND|
   2    6   17   17 =META|str
   2    9   20   20 -TAG |
   2    9   20   20 -PROP|
   2    9   20   20 =WSPC|.
   2   10   21   21 +VAL |
   2   10   21   21 =TEXT|a
   2   11   22   22 -VAL |
   2   11   22   22 -NODE|
   2   11   22   22 =EOL |\x0a
   3    0   23   23 =DENT|..
   3    2   25   25 =SYNX|-
   3    3   26   26 +NODE|
   3    3   26   26 =WSPC|.
   3    4   27   27 +PROP|
   3    4   27   27 +TAG |
   3    4   27   27 +HAND|
   3    4   27   27 =SYNX|!
   3    5   28   28 =SYNX|!
   3    6   29   29 -HAND|
   3    6   29   29 =META|map
   3    9   32   32 -TAG |
   3    9   32   32 -PROP|
   3    9   32   32 =EOL |\x0a
   4    0   33   33 +MAP |
   4    0   33   33 =DENT|....
   4    4   37   37 +PAIR|
   4    4   37   37 +NODE|
   4    4   37   37 +VAL |
   4    4   37   37 =TEXT|key
   4    7   40   40 -VAL |
   4    7   40   40 -NODE|
   4    7   40   40 =SYNX|:
   4    8   41   41 =WSPC|.
   4    9   42   42 +NODE|
   4    9   42   42 +PROP|
   4    9   42   42 +TAG |
   4    9   42   42 +HAND|
   4    9   42   42 =SYNX|!
   4   10   43   43 =SYNX|!
   4   11   44   44 -HAND|
   4   11   44   44 =META|str
   4   14   47   47 -TAG |
   4   14   47   47 -PROP|
   4   14   47   47 =WSPC|.
   4   15   48   48 +VAL |
   4   15   48   48 =TEXT|value
   4   20   53   53 -VAL |
   4   20   53   53 -NODE|
   4   20   53   53 =EOL |\x0a
   5    0   54   54 -PAIR|
   5    0   54   54 -MAP |
   5    0   54   54 -NODE|
   5    0   54   54 -SEQ |
   5    0   54   54 -NODE|
   5    0   54   54 -PAIR|
   5    0   54   54 -MAP |
   5    0   54   54 -NODE|
   5    0   54   54 -DOC |

perl-pp-perl

 na
{
  'foo' => [
             'a',
             {
               'key' => 'value'
             }
           ]
}

perl-pplibyaml-perl

 na
{
  'foo' => [
             'a',
             {
               'key' => 'value'
             }
           ]
}

perl-syck-perl

 na
{
  'foo' => [
             'a',
             {
               'key' => 'value'
             }
           ]
}

perl-xs-perl

 na
{
  'foo' => [
             'a',
             {
               'key' => 'value'
             }
           ]
}

perl-yaml-perl

 na
{
  'foo' => [
             'a',
             {
               'key' => 'value'
             }
           ]
}

py-pyyaml-py

 na
{'foo': ['a', {'key': 'value'}]}

py-ruamel-py

 na
{'foo': ['a', {'key': 'value'}]}

perl-tiny-json

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

perl-tiny-perl

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