# YAML Test Matrix

--- &test-J7PZ
  Title: Spec Example 2.26. Ordered Mappings
  Tags: [ mapping, spec, tag, unknown-tag ]

YAML

# The !!omap tag is one of the optional types
# introduced for YAML 1.1. In 1.2, it is not
# part of the standard tags and should not be
# enabled by default.
# Ordered maps are represented as
# A sequence of mappings, with
# each mapping having one key
--- !!omap
- Mark McGwire: 65
- Sammy Sosa: 63
- Ken Griffy: 58

Expected Events

+STR
+DOC ---
+SEQ <tag:yaml.org,2002:omap>
+MAP
=VAL :Mark McGwire
=VAL :65
-MAP
+MAP
=VAL :Sammy Sosa
=VAL :63
-MAP
+MAP
=VAL :Ken Griffy
=VAL :58
-MAP
-SEQ
-DOC
-STR

Expected JSON

[
{
"Mark McGwire": 65
},
{
"Sammy Sosa": 63
},
{
"Ken Griffy": 58
}
]

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

py-pyyaml-event

 ok

py-ruamel-event

 ok

c-libfyaml-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-yaml-json

 json_ok

java-snakeyaml-json

 json_diff
{
  "Ken Griffy": 58,
  "Mark McGwire": 65,
  "Sammy Sosa": 63
}

py-pyyaml-json

 json_diff
[
  [
    "Mark McGwire",
    65
  ],
  [
    "Sammy Sosa",
    63
  ],
  [
    "Ken Griffy",
    58
  ]
]

py-ruamel-json

 json_diff
{
  "Ken Griffy": 58,
  "Mark McGwire": 65,
  "Sammy Sosa": 63
}

ruby-psych-json

 json_diff
{
  "Ken Griffy": 58,
  "Mark McGwire": 65,
  "Sammy Sosa": 63
}

perl-pp-perl

 na
[
  {
    'Mark McGwire' => 65
  },
  {
    'Sammy Sosa' => 63
  },
  {
    'Ken Griffy' => 58
  }
]

perl-pplibyaml-perl

 na
[
  {
    'Mark McGwire' => 65
  },
  {
    'Sammy Sosa' => 63
  },
  {
    'Ken Griffy' => 58
  }
]

perl-syck-perl

 na
[
  {
    'Mark McGwire' => 65
  },
  {
    'Sammy Sosa' => 63
  },
  {
    'Ken Griffy' => 58
  }
]

perl-yaml-perl

 na
[
  {
    'Mark McGwire' => 65
  },
  {
    'Sammy Sosa' => 63
  },
  {
    'Ken Griffy' => 58
  }
]

py-pyyaml-py

 na
[('Mark McGwire', 65), ('Sammy Sosa', 63), ('Ken Griffy', 58)]

py-ruamel-py

 na
ordereddict([('Mark McGwire', 65), ('Sammy Sosa', 63), ('Ken Griffy', 58)])

dotnet-yamldotnet-json

 ni
Unhandled exception. YamlDotNet.Core.YamlException: (Line: 8, Col: 5, Idx: 258) - (Line: 9, Col: 1, Idx: 265): Encountered an unresolved tag 'tag:yaml.org,2002:omap'
   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.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-tiny-json

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

perl-tiny-perl

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

perl-xs-json

 ni
YAML::XS::Load Error: The problem:

    bad tag found for array: 'tag:yaml.org,2002:omap'

was found at document: 1

perl-xs-perl

 ni
YAML::XS::Load Error: The problem:

    bad tag found for array: 'tag:yaml.org,2002:omap'

was found at document: 1