# YAML Test Matrix

--- &test-229Q
  Title: Spec Example 2.4. Sequence of Mappings
  Tags: [ mapping, sequence, spec ]

YAML

-
  name: Mark McGwire
  hr:   65
  avg:  0.278
-
  name: Sammy Sosa
  hr:   63
  avg:  0.288

Expected Events

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

Expected JSON

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

cpp-event

 ok

hs-yaml-event

 ok

java-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-yaml-json

 json_ok

luajit-json

 json_ok

perl5-pm-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-tiny-json

 json_diff
[
  {
    "avg": "0.278",
    "hr": "65",
    "name": "Mark McGwire"
  },
  {
    "avg": "0.288",
    "hr": "63",
    "name": "Sammy Sosa"
  }
]

perl5-pm-pl

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

perl5-pp-pl

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

perl5-syck-pl

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

perl5-tiny-pl

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

perl5-xs-pl

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

pyyaml-py

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

ruamel-py

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