# YAML Test Matrix

--- &test-ZF4X
  Title: Spec Example 2.6. Mapping of Mappings
  Tags: [ mapping, spec ]

YAML

Mark McGwire: {hr: 65, avg: 0.278}
Sammy Sosa: {
    hr: 63,
    avg: 0.288
  }

Expected Events

+STR
+DOC
+MAP
=VAL :Mark McGwire
+MAP
=VAL :hr
=VAL :65
=VAL :avg
=VAL :0.278
-MAP
=VAL :Sammy Sosa
+MAP
=VAL :hr
=VAL :63
=VAL :avg
=VAL :0.288
-MAP
-MAP
-DOC
-STR

Expected JSON

{
"Mark McGwire": {
"hr": 65,
"avg": 0.278
},
"Sammy Sosa": {
"hr": 63,
"avg": 0.288
}
}

cpp-event

 ok

hs-yaml-event

 ok

java-event

 ok

js-event

 ok

libyaml-event

 ok

nimyaml-event

 ok

perl5-pegex-event

 ok

perl5-pp-event

 ok

pyyaml-event

 ok

ruamel-event

 ok

hs-yaml-json

 json_ok

java-json

 json_ok

js-json

 json_ok

js-yaml-json

 json_ok

luajit-json

 json_ok

perl5-pp-json

 json_ok

perl5-syck-json

 json_ok

perl5-xs-json

 json_ok

pyyaml-json

 json_ok

ruamel-json

 json_ok

ruby-json

 json_ok

perl5-pm-json

 error
YAML Error: Inconsistent indentation level
   Code: YAML_PARSE_ERR_INCONSISTENT_INDENTATION
   Line: 3
   Document: 1
 at /lib/perl5/YAML/Loader.pm line 804.

perl5-pm-pl

 error
YAML Error: Inconsistent indentation level
   Code: YAML_PARSE_ERR_INCONSISTENT_INDENTATION
   Line: 3
   Document: 1
 at /lib/perl5/YAML/Loader.pm line 804.

perl5-tiny-json

 error
YAML::Tiny found illegal characters in plain scalar: '{hr: 65, avg: 0.278}' at /bin/perl5-tiny-json line 12.

perl5-tiny-pl

 error
YAML::Tiny found illegal characters in plain scalar: '{hr: 65, avg: 0.278}' at /bin/perl5-tiny-pl line 15.

perl5-pp-pl

 na
{
  'Mark McGwire' => {
                    'avg' => '0.278',
                    'hr' => 65
                  },
  'Sammy Sosa' => {
                  'avg' => '0.288',
                  'hr' => 63
                }
}

perl5-syck-pl

 na
{
  'Mark McGwire' => {
                    'avg' => '0.278',
                    'hr' => 65
                  },
  'Sammy Sosa' => {
                  'avg' => '0.288',
                  'hr' => 63
                }
}

perl5-xs-pl

 na
{
  'Mark McGwire' => {
                      'avg' => '0.278',
                      'hr' => 65
                    },
  'Sammy Sosa' => {
                    'avg' => '0.288',
                    'hr' => 63
                  }
}

pyyaml-py

 na
{'Mark McGwire': {'avg': 0.278, 'hr': 65},
 'Sammy Sosa': {'avg': 0.288, 'hr': 63}}

ruamel-py

 na
{'Mark McGwire': {'avg': 0.278, 'hr': 65},
 'Sammy Sosa': {'avg': 0.288, 'hr': 63}}