# YAML Test Matrix

--- &test-ZF4X
  Title: Spec Example 2.6. Mapping of Mappings
  Tags: [ flow, 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": {
"avg": 0.278,
"hr": 65
},
"Sammy Sosa": {
"avg": 0.288,
"hr": 63
}
}

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

py-pyyaml-json

 json_ok

py-ruamel-json

 json_ok

ruby-psych-json

 json_ok

dotnet-yamldotnet-json

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

perl-yaml-json

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

perl-yaml-perl

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

hs-reference-yeast

 na
Line  Col Char Byte Token|Content
   1    0    0    0 +DOC |
   1    0    0    0 +NODE|
   1    0    0    0 +MAP |
   1    0    0    0 +PAIR|
   1    0    0    0 +NODE|
   1    0    0    0 +VAL |
   1    0    0    0 =TEXT|Mark.McGwire
   1   12   12   12 -VAL |
   1   12   12   12 -NODE|
   1   12   12   12 =SYNX|:
   1   13   13   13 =WSPC|.
   1   14   14   14 +NODE|
   1   14   14   14 +MAP |
   1   14   14   14 =SYNX|{
   1   15   15   15 +PAIR|
   1   15   15   15 +NODE|
   1   15   15   15 +VAL |
   1   15   15   15 =TEXT|hr
   1   17   17   17 -VAL |
   1   17   17   17 -NODE|
   1   17   17   17 =SYNX|:
   1   18   18   18 =WSPC|.
   1   19   19   19 +NODE|
   1   19   19   19 +VAL |
   1   19   19   19 =TEXT|65
   1   21   21   21 -VAL |
   1   21   21   21 -NODE|
   1   21   21   21 -PAIR|
   1   21   21   21 =SYNX|,
   1   22   22   22 =WSPC|.
   1   23   23   23 +PAIR|
   1   23   23   23 +NODE|
   1   23   23   23 +VAL |
   1   23   23   23 =TEXT|avg
   1   26   26   26 -VAL |
   1   26   26   26 -NODE|
   1   26   26   26 =SYNX|:
   1   27   27   27 =WSPC|.
   1   28   28   28 +NODE|
   1   28   28   28 +VAL |
   1   28   28   28 =TEXT|0.278
   1   33   33   33 -VAL |
   1   33   33   33 -NODE|
   1   33   33   33 -PAIR|
   1   33   33   33 =SYNX|}
   1   34   34   34 -MAP |
   1   34   34   34 -NODE|
   1   34   34   34 =EOL |\x0a
   2    0   35   35 -PAIR|
   2    0   35   35 +PAIR|
   2    0   35   35 +NODE|
   2    0   35   35 +VAL |
   2    0   35   35 =TEXT|Sammy.Sosa
   2   10   45   45 -VAL |
   2   10   45   45 -NODE|
   2   10   45   45 =SYNX|:
   2   11   46   46 =WSPC|.
   2   12   47   47 +NODE|
   2   12   47   47 +MAP |
   2   12   47   47 =SYNX|{
   2   13   48   48 =EOL |\x0a
   3    0   49   49 =DENT|.
   3    1   50   50 =WSPC|...
   3    4   53   53 +PAIR|
   3    4   53   53 +NODE|
   3    4   53   53 +VAL |
   3    4   53   53 =TEXT|hr
   3    6   55   55 -VAL |
   3    6   55   55 -NODE|
   3    6   55   55 =SYNX|:
   3    7   56   56 =WSPC|.
   3    8   57   57 +NODE|
   3    8   57   57 +VAL |
   3    8   57   57 =TEXT|63
   3   10   59   59 -VAL |
   3   10   59   59 -NODE|
   3   10   59   59 -PAIR|
   3   10   59   59 =SYNX|,
   3   11   60   60 =EOL |\x0a
   4    0   61   61 =DENT|.
   4    1   62   62 =WSPC|...
   4    4   65   65 +PAIR|
   4    4   65   65 +NODE|
   4    4   65   65 +VAL |
   4    4   65   65 =TEXT|avg
   4    7   68   68 -VAL |
   4    7   68   68 -NODE|
   4    7   68   68 =SYNX|:
   4    8   69   69 =WSPC|.
   4    9   70   70 +NODE|
   4    9   70   70 +VAL |
   4    9   70   70 =TEXT|0.288
   4   14   75   75 -VAL |
   4   14   75   75 -NODE|
   4   14   75   75 -PAIR|
   4   14   75   75 =EOL |\x0a
   5    0   76   76 =DENT|.
   5    1   77   77 =WSPC|.
   5    2   78   78 =SYNX|}
   5    3   79   79 -MAP |
   5    3   79   79 -NODE|
   5    3   79   79 =EOL |\x0a
   6    0   80   80 -PAIR|
   6    0   80   80 -MAP |
   6    0   80   80 -NODE|
   6    0   80   80 -DOC |

perl-pp-perl

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

perl-pplibyaml-perl

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

perl-syck-perl

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

perl-xs-perl

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

py-pyyaml-py

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

py-ruamel-py

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

perl-tiny-json

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

perl-tiny-perl

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