# YAML Test Matrix

--- &test-R52L
  Title: Nested flow mapping sequence and mappings
  Tags: [ flow, mapping, sequence ]

YAML

---
{ top1: [item1, {key2: value2}, item3], top2: value2 }

Expected Events

+STR
+DOC ---
+MAP
=VAL :top1
+SEQ
=VAL :item1
+MAP
=VAL :key2
=VAL :value2
-MAP
=VAL :item3
-SEQ
=VAL :top2
=VAL :value2
-MAP
-DOC
-STR

Expected JSON

{
"top1": [
"item1",
{
"key2": "value2"
},
"item3"
],
"top2": "value2"
}

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: Invalid element in map
   Code: YAML_LOAD_ERR_BAD_MAP_ELEMENT
   Line: 2
   Document: 1
 at /lib/perl5/YAML/Loader.pm line 360.

perl5-pm-pl

 error
YAML Error: Invalid element in map
   Code: YAML_LOAD_ERR_BAD_MAP_ELEMENT
   Line: 2
   Document: 1
 at /lib/perl5/YAML/Loader.pm line 360.

perl5-tiny-json

 error
YAML::Tiny found illegal characters in plain scalar: '[item1, {key2: value2}, item3], top2: value2 }' at /bin/perl5-tiny-json line 12.

perl5-tiny-pl

 error
YAML::Tiny found illegal characters in plain scalar: '[item1, {key2: value2}, item3], top2: value2 }' at /bin/perl5-tiny-pl line 15.

perl5-pp-pl

 na
{
  'top1' => [
            'item1',
            {
              'key2' => 'value2'
            },
            'item3'
          ],
  'top2' => 'value2'
}

perl5-syck-pl

 na
{
  'top1' => [
            'item1',
            {
              'key2' => 'value2'
            },
            'item3'
          ],
  'top2' => 'value2'
}

perl5-xs-pl

 na
{
  'top1' => [
              'item1',
              {
                'key2' => 'value2'
              },
              'item3'
            ],
  'top2' => 'value2'
}

pyyaml-py

 na
{'top1': ['item1', {'key2': 'value2'}, 'item3'], 'top2': 'value2'}

ruamel-py

 na
{'top1': ['item1', {'key2': 'value2'}, 'item3'], 'top2': 'value2'}