# YAML Test Matrix

--- &test-57H4
  Title: Spec Example 8.22. Block Collection Nodes
  Tags: [ mapping, sequence, tag ]

YAML

sequence: !!seq
- entry
- !!seq
 - nested
mapping: !!map
 foo: bar

Expected Events

+STR
+DOC
+MAP
=VAL :sequence
+SEQ <tag:yaml.org,2002:seq>
=VAL :entry
+SEQ <tag:yaml.org,2002:seq>
=VAL :nested
-SEQ
-SEQ
=VAL :mapping
+MAP <tag:yaml.org,2002:map>
=VAL :foo
=VAL :bar
-MAP
-MAP
-DOC
-STR

Expected JSON

{
"mapping": {
"foo": "bar"
},
"sequence": [
"entry",
[
"nested"
]
]
}

c-libfyaml-event

 ok

c-libyaml-event

 ok

cpp-yamlcpp-event

 ok

dotnet-yamldotnet-event

 ok

hs-hsyaml-event

 ok

java-snakeyaml-event

 ok

js-yaml-event

 ok

nim-nimyaml-event

 ok

perl-pp-event

 ok

perl-pplibyaml-event

 ok

perl-refparser-event

 ok

py-pyyaml-event

 ok

py-ruamel-event

 ok

c-libfyaml-json

 json_ok

hs-hsyaml-json

 json_ok

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

 json_ok

perl-yaml-json

 json_ok

py-pyyaml-json

 json_ok

py-ruamel-json

 json_ok

ruby-psych-json

 json_ok

dotnet-yamldotnet-json

 error
Unhandled exception. YamlDotNet.Core.YamlException: (Line: 1, Col: 11, Idx: 10) - (Line: 2, Col: 2, Idx: 17): 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)

perl-syck-json

 error
Syck parser (line 4, column 1): syntax error at /perl5/lib/perl5/x86_64-linux-thread-multi/YAML/Syck.pm line 60, <> line 1.

perl-syck-perl

 error
Syck parser (line 4, column 1): syntax error at /perl5/lib/perl5/x86_64-linux-thread-multi/YAML/Syck.pm line 60, <> line 1.

perl-pp-perl

 na
{
  'mapping' => {
                 'foo' => 'bar'
               },
  'sequence' => [
                  'entry',
                  [
                    'nested'
                  ]
                ]
}

perl-pplibyaml-perl

 na
{
  'mapping' => {
                 'foo' => 'bar'
               },
  'sequence' => [
                  'entry',
                  [
                    'nested'
                  ]
                ]
}

perl-xs-perl

 na
{
  'mapping' => {
                 'foo' => 'bar'
               },
  'sequence' => [
                  'entry',
                  [
                    'nested'
                  ]
                ]
}

perl-yaml-perl

 na
{
  'mapping' => {
                 'foo' => 'bar'
               },
  'sequence' => [
                  'entry',
                  [
                    'nested'
                  ]
                ]
}

py-pyyaml-py

 na
{'mapping': {'foo': 'bar'}, 'sequence': ['entry', ['nested']]}

py-ruamel-py

 na
{'mapping': {'foo': 'bar'}, 'sequence': ['entry', ['nested']]}

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.