# YAML Test Matrix

--- &test-7BUB
  Title: Spec Example 2.10. Node for “Sammy Sosa” appears twice in this document
  Tags: [ alias, spec ]

YAML

---
hr:
  - Mark McGwire
  # Following node labeled SS
  - &SS Sammy Sosa
rbi:
  - *SS # Subsequent occurrence
  - Ken Griffey

Expected Events

+STR
+DOC ---
+MAP
=VAL :hr
+SEQ
=VAL :Mark McGwire
=VAL &SS :Sammy Sosa
-SEQ
=VAL :rbi
+SEQ
=ALI *SS
=VAL :Ken Griffey
-SEQ
-MAP
-DOC
-STR

Expected JSON

{
"hr": [
"Mark McGwire",
"Sammy Sosa"
],
"rbi": [
"Sammy Sosa",
"Ken Griffey"
]
}

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

 error
YAML::Tiny does not support a feature in line '&SS Sammy Sosa' at /bin/perl5-tiny-json line 12.

perl5-tiny-pl

 error
YAML::Tiny does not support a feature in line '&SS Sammy Sosa' at /bin/perl5-tiny-pl line 15.

perl5-pm-pl

 na
{
  'hr' => [
          'Mark McGwire',
          'Sammy Sosa'
        ],
  'rbi' => [
           'Sammy Sosa',
           'Ken Griffey'
         ]
}

perl5-pp-pl

 na
{
  'hr' => [
          'Mark McGwire',
          'Sammy Sosa'
        ],
  'rbi' => [
           'Sammy Sosa',
           'Ken Griffey'
         ]
}

perl5-syck-pl

 na
{
  'hr' => [
          'Mark McGwire',
          'Sammy Sosa'
        ],
  'rbi' => [
           'Sammy Sosa',
           'Ken Griffey'
         ]
}

perl5-xs-pl

 na
{
  'hr' => [
            'Mark McGwire',
            'Sammy Sosa'
          ],
  'rbi' => [
             ${\$VAR1->{'hr'}[1]},
             'Ken Griffey'
           ]
}

pyyaml-py

 na
{'hr': ['Mark McGwire', 'Sammy Sosa'], 'rbi': ['Sammy Sosa', 'Ken Griffey']}

ruamel-py

 na
{'hr': ['Mark McGwire', 'Sammy Sosa'], 'rbi': ['Sammy Sosa', 'Ken Griffey']}