# YAML Test Matrix

--- &test-9U5K
  Title: Spec Example 2.12. Compact Nested Mapping
  Tags: [ mapping, sequence, spec ]

YAML

---
# Products purchased
- item    : Super Hoop
  quantity: 1
- item    : Basketball
  quantity: 4
- item    : Big Shoes
  quantity: 1

Expected Events

+STR
+DOC ---
+SEQ
+MAP
=VAL :item
=VAL :Super Hoop
=VAL :quantity
=VAL :1
-MAP
+MAP
=VAL :item
=VAL :Basketball
=VAL :quantity
=VAL :4
-MAP
+MAP
=VAL :item
=VAL :Big Shoes
=VAL :quantity
=VAL :1
-MAP
-SEQ
-DOC
-STR

Expected JSON

[
{
"item": "Super Hoop",
"quantity": 1
},
{
"item": "Basketball",
"quantity": 4
},
{
"item": "Big Shoes",
"quantity": 1
}
]

cpp-event

 ok

hs-yaml-event

 ok

java-event

 ok

js-event

 ok

libyaml-event

 ok

nimyaml-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-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-pegex-event

 diff
Got Events:
+STR
+DOC ---
+SEQ
=VAL :item
-SEQ
-DOC
+DOC
+MAP
=VAL :
=VAL :Super Hoop
-MAP
-DOC
+DOC
+MAP
=VAL :quantity
=VAL :1
-MAP
-DOC
+DOC
+SEQ
=VAL :item
-SEQ
-DOC
+DOC
+MAP
=VAL :
=VAL :Basketball
-MAP
-DOC
+DOC
+MAP
=VAL :quantity
=VAL :4
-MAP
-DOC
+DOC
+SEQ
=VAL :item
-SEQ
-DOC
+DOC
+MAP
=VAL :
=VAL :Big Shoes
-MAP
-DOC
+DOC
+MAP
=VAL :quantity
=VAL :1
-MAP
-DOC
-STR

perl5-tiny-json

 json_diff
[
  {
    "item": "Super Hoop",
    "quantity": "1"
  },
  {
    "item": "Basketball",
    "quantity": "4"
  },
  {
    "item": "Big Shoes",
    "quantity": "1"
  }
]

perl5-pm-pl

 na
[
  {
    'item' => 'Super Hoop',
    'quantity' => 1
  },
  {
    'item' => 'Basketball',
    'quantity' => 4
  },
  {
    'item' => 'Big Shoes',
    'quantity' => 1
  }
]

perl5-pp-pl

 na
[
  {
    'item' => 'Super Hoop',
    'quantity' => 1
  },
  {
    'item' => 'Basketball',
    'quantity' => 4
  },
  {
    'item' => 'Big Shoes',
    'quantity' => 1
  }
]

perl5-syck-pl

 na
[
  {
    'item' => 'Super Hoop',
    'quantity' => 1
  },
  {
    'item' => 'Basketball',
    'quantity' => 4
  },
  {
    'item' => 'Big Shoes',
    'quantity' => 1
  }
]

perl5-tiny-pl

 na
[
  {
    'item' => 'Super Hoop',
    'quantity' => '1'
  },
  {
    'item' => 'Basketball',
    'quantity' => '4'
  },
  {
    'item' => 'Big Shoes',
    'quantity' => '1'
  }
]

perl5-xs-pl

 na
[
  {
    'item' => 'Super Hoop',
    'quantity' => 1
  },
  {
    'item' => 'Basketball',
    'quantity' => 4
  },
  {
    'item' => 'Big Shoes',
    'quantity' => 1
  }
]

pyyaml-py

 na
[{'item': 'Super Hoop', 'quantity': 1},
 {'item': 'Basketball', 'quantity': 4},
 {'item': 'Big Shoes', 'quantity': 1}]

ruamel-py

 na
[{'item': 'Super Hoop', 'quantity': 1},
 {'item': 'Basketball', 'quantity': 4},
 {'item': 'Big Shoes', 'quantity': 1}]