# 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

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

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

rust-yamlrust-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

perl-yaml-json

 json_ok

py-pyyaml-json

 json_ok

py-ruamel-json

 json_ok

ruby-psych-json

 json_ok

dotnet-yamldotnet-json

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

perl-tiny-json

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

hs-reference-yeast

 na
Line  Col Char Byte Token|Content
   1    0    0    0 +DOC |
   1    0    0    0 +NODE|
   1    0    0    0 +SEQ |
   1    0    0    0 =SYNX|-
   1    1    1    1 +NODE|
   1    1    1    1 =EOL |\x0a
   2    0    2    2 +MAP |
   2    0    2    2 =DENT|..
   2    2    4    4 +PAIR|
   2    2    4    4 +NODE|
   2    2    4    4 +VAL |
   2    2    4    4 =TEXT|name
   2    6    8    8 -VAL |
   2    6    8    8 -NODE|
   2    6    8    8 =SYNX|:
   2    7    9    9 =WSPC|.
   2    8   10   10 +NODE|
   2    8   10   10 +VAL |
   2    8   10   10 =TEXT|Mark.McGwire
   2   20   22   22 -VAL |
   2   20   22   22 -NODE|
   2   20   22   22 =EOL |\x0a
   3    0   23   23 -PAIR|
   3    0   23   23 =DENT|..
   3    2   25   25 +PAIR|
   3    2   25   25 +NODE|
   3    2   25   25 +VAL |
   3    2   25   25 =TEXT|hr
   3    4   27   27 -VAL |
   3    4   27   27 -NODE|
   3    4   27   27 =SYNX|:
   3    5   28   28 =WSPC|...
   3    8   31   31 +NODE|
   3    8   31   31 +VAL |
   3    8   31   31 =TEXT|65
   3   10   33   33 -VAL |
   3   10   33   33 -NODE|
   3   10   33   33 =EOL |\x0a
   4    0   34   34 -PAIR|
   4    0   34   34 =DENT|..
   4    2   36   36 +PAIR|
   4    2   36   36 +NODE|
   4    2   36   36 +VAL |
   4    2   36   36 =TEXT|avg
   4    5   39   39 -VAL |
   4    5   39   39 -NODE|
   4    5   39   39 =SYNX|:
   4    6   40   40 =WSPC|..
   4    8   42   42 +NODE|
   4    8   42   42 +VAL |
   4    8   42   42 =TEXT|0.278
   4   13   47   47 -VAL |
   4   13   47   47 -NODE|
   4   13   47   47 =EOL |\x0a
   5    0   48   48 -PAIR|
   5    0   48   48 -MAP |
   5    0   48   48 -NODE|
   5    0   48   48 =SYNX|-
   5    1   49   49 +NODE|
   5    1   49   49 =EOL |\x0a
   6    0   50   50 +MAP |
   6    0   50   50 =DENT|..
   6    2   52   52 +PAIR|
   6    2   52   52 +NODE|
   6    2   52   52 +VAL |
   6    2   52   52 =TEXT|name
   6    6   56   56 -VAL |
   6    6   56   56 -NODE|
   6    6   56   56 =SYNX|:
   6    7   57   57 =WSPC|.
   6    8   58   58 +NODE|
   6    8   58   58 +VAL |
   6    8   58   58 =TEXT|Sammy.Sosa
   6   18   68   68 -VAL |
   6   18   68   68 -NODE|
   6   18   68   68 =EOL |\x0a
   7    0   69   69 -PAIR|
   7    0   69   69 =DENT|..
   7    2   71   71 +PAIR|
   7    2   71   71 +NODE|
   7    2   71   71 +VAL |
   7    2   71   71 =TEXT|hr
   7    4   73   73 -VAL |
   7    4   73   73 -NODE|
   7    4   73   73 =SYNX|:
   7    5   74   74 =WSPC|...
   7    8   77   77 +NODE|
   7    8   77   77 +VAL |
   7    8   77   77 =TEXT|63
   7   10   79   79 -VAL |
   7   10   79   79 -NODE|
   7   10   79   79 =EOL |\x0a
   8    0   80   80 -PAIR|
   8    0   80   80 =DENT|..
   8    2   82   82 +PAIR|
   8    2   82   82 +NODE|
   8    2   82   82 +VAL |
   8    2   82   82 =TEXT|avg
   8    5   85   85 -VAL |
   8    5   85   85 -NODE|
   8    5   85   85 =SYNX|:
   8    6   86   86 =WSPC|..
   8    8   88   88 +NODE|
   8    8   88   88 +VAL |
   8    8   88   88 =TEXT|0.288
   8   13   93   93 -VAL |
   8   13   93   93 -NODE|
   8   13   93   93 =EOL |\x0a
   9    0   94   94 -PAIR|
   9    0   94   94 -MAP |
   9    0   94   94 -NODE|
   9    0   94   94 -SEQ |
   9    0   94   94 -NODE|
   9    0   94   94 -DOC |

perl-pp-perl

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

perl-pplibyaml-perl

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

perl-syck-perl

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

perl-tiny-perl

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

perl-xs-perl

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

perl-yaml-perl

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

py-pyyaml-py

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

py-ruamel-py

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