# YAML Test Matrix

--- &test-7ZZ5
  Title: Empty flow collections
  Tags: [ flow, mapping, sequence ]

YAML

---
nested sequences:
- - - []
- - - {}
key1: []
key2: {}

Expected Events

+STR
+DOC ---
+MAP
=VAL :nested sequences
+SEQ
+SEQ
+SEQ
+SEQ
-SEQ
-SEQ
-SEQ
+SEQ
+SEQ
+MAP
-MAP
-SEQ
-SEQ
-SEQ
=VAL :key1
+SEQ
-SEQ
=VAL :key2
+MAP
-MAP
-MAP
-DOC
-STR

Expected JSON

{
"nested sequences": [
[
[
[]
]
],
[
[
{}
]
]
],
"key1": [],
"key2": {}
}

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

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 ---
+MAP
=VAL :nested sequences
+SEQ
+SEQ
+SEQ
+SEQ
-SEQ
-SEQ
-SEQ
=VAL :- - {}
-SEQ
=VAL :key1
+SEQ
-SEQ
=VAL :key2
+MAP
-MAP
-MAP
-DOC
-STR

luajit-json

 json_diff
{
  "key1": {},
  "key2": {},
  "nested sequences": [
    [
      [
        {}
      ]
    ],
    [
      [
        {}
      ]
    ]
  ]
}

perl5-tiny-json

 error
YAML::Tiny found illegal characters in plain scalar: '- - []' at /bin/perl5-tiny-json line 12.

perl5-tiny-pl

 error
YAML::Tiny found illegal characters in plain scalar: '- - []' at /bin/perl5-tiny-pl line 15.

perl5-pm-pl

 na
{
  'key1' => [],
  'key2' => {},
  'nested sequences' => [
                        [
                          [
                            []
                          ]
                        ],
                        [
                          [
                            {}
                          ]
                        ]
                      ]
}

perl5-pp-pl

 na
{
  'key1' => [],
  'key2' => {},
  'nested sequences' => [
                        [
                          [
                            []
                          ]
                        ],
                        [
                          [
                            {}
                          ]
                        ]
                      ]
}

perl5-syck-pl

 na
{
  'key1' => [],
  'key2' => {},
  'nested sequences' => [
                        [
                          [
                            []
                          ]
                        ],
                        [
                          [
                            {}
                          ]
                        ]
                      ]
}

perl5-xs-pl

 na
{
  'key1' => [],
  'key2' => {},
  'nested sequences' => [
                          [
                            [
                              []
                            ]
                          ],
                          [
                            [
                              {}
                            ]
                          ]
                        ]
}

pyyaml-py

 na
{'key1': [], 'key2': {}, 'nested sequences': [[[[]]], [[{}]]]}

ruamel-py

 na
{'key1': [], 'key2': {}, 'nested sequences': [[[[]]], [[{}]]]}