# YAML Test Matrix

--- &test-EHF6
  Title: Tags for Flow Objects
  Tags: [ flow, mapping, sequence, tag ]

YAML

!!map {
  k: !!seq
  [ a, !!str b]
}

Expected Events

+STR
+DOC
+MAP {} <tag:yaml.org,2002:map>
=VAL :k
+SEQ [] <tag:yaml.org,2002:seq>
=VAL :a
=VAL <tag:yaml.org,2002:str> :b
-SEQ
-MAP
-DOC
-STR

Expected JSON

{
"k": [
"a",
"b"
]
}

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

dotnet-yamldotnet-json

 error
Unhandled exception. YamlDotNet.Core.YamlException: (Line: 2, Col: 6, Idx: 13) - (Line: 3, Col: 3, Idx: 21): 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-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 +PROP|
   1    0    0    0 +TAG |
   1    0    0    0 +HAND|
   1    0    0    0 =SYNX|!
   1    1    1    1 =SYNX|!
   1    2    2    2 -HAND|
   1    2    2    2 =META|map
   1    5    5    5 -TAG |
   1    5    5    5 -PROP|
   1    5    5    5 =WSPC|.
   1    6    6    6 +MAP |
   1    6    6    6 =SYNX|{
   1    7    7    7 =EOL |\x0a
   2    0    8    8 =WSPC|..
   2    2   10   10 +PAIR|
   2    2   10   10 +NODE|
   2    2   10   10 +VAL |
   2    2   10   10 =TEXT|k
   2    3   11   11 -VAL |
   2    3   11   11 -NODE|
   2    3   11   11 =SYNX|:
   2    4   12   12 =WSPC|.
   2    5   13   13 +NODE|
   2    5   13   13 +PROP|
   2    5   13   13 +TAG |
   2    5   13   13 +HAND|
   2    5   13   13 =SYNX|!
   2    6   14   14 =SYNX|!
   2    7   15   15 -HAND|
   2    7   15   15 =META|seq
   2   10   18   18 -TAG |
   2   10   18   18 -PROP|
   2   10   18   18 =EOL |\x0a
   3    0   19   19 =WSPC|..
   3    2   21   21 +SEQ |
   3    2   21   21 =SYNX|[
   3    3   22   22 =WSPC|.
   3    4   23   23 +NODE|
   3    4   23   23 +VAL |
   3    4   23   23 =TEXT|a
   3    5   24   24 -VAL |
   3    5   24   24 -NODE|
   3    5   24   24 =SYNX|,
   3    6   25   25 =WSPC|.
   3    7   26   26 +NODE|
   3    7   26   26 +PROP|
   3    7   26   26 +TAG |
   3    7   26   26 +HAND|
   3    7   26   26 =SYNX|!
   3    8   27   27 =SYNX|!
   3    9   28   28 -HAND|
   3    9   28   28 =META|str
   3   12   31   31 -TAG |
   3   12   31   31 -PROP|
   3   12   31   31 =WSPC|.
   3   13   32   32 +VAL |
   3   13   32   32 =TEXT|b
   3   14   33   33 -VAL |
   3   14   33   33 -NODE|
   3   14   33   33 =SYNX|]
   3   15   34   34 -SEQ |
   3   15   34   34 -NODE|
   3   15   34   34 -PAIR|
   3   15   34   34 =EOL |\x0a
   4    0   35   35 =SYNX|}
   4    1   36   36 -MAP |
   4    1   36   36 -NODE|
   4    1   36   36 =EOL |\x0a
   5    0   37   37 -DOC |

perl-pp-perl

 na
{
  'k' => [
           'a',
           'b'
         ]
}

perl-pplibyaml-perl

 na
{
  'k' => [
           'a',
           'b'
         ]
}

perl-syck-perl

 na
{
  'k' => [
           'a',
           'b'
         ]
}

perl-xs-perl

 na
{
  'k' => [
           'a',
           'b'
         ]
}

py-pyyaml-py

 na
{'k': ['a', 'b']}

py-ruamel-py

 na
{'k': ['a', 'b']}

perl-tiny-json

 ni
YAML::Tiny failed to classify line '!!map {' at /yaml/bin/perl-tiny-json line 12.

perl-tiny-perl

 ni
YAML::Tiny failed to classify line '!!map {' at /yaml/bin/perl-tiny-perl line 15.