# 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

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

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

dotnet-yamldotnet-json

 json_ok

go-yaml-json

 json_ok

hs-hsyaml-json

 json_ok

js-jsyaml-json

 json_ok

js-yaml-json

 json_ok

perl-pp-json

 json_ok

perl-pplibyaml-json

 json_ok

perl-syck-json

 json_ok

perl-xs-json

 json_ok

perl-yaml-json

 json_ok

py-pyyaml-json

 json_ok

py-ruamel-json

 json_ok

ruby-psych-json

 json_ok

lua-lyaml-json

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

hs-reference-yeast

 na
Line  Col Char Byte Token|Content
   1    0    0    0 +DOC |
   1    0    0    0 =HEAD|---
   1    3    3    3 +NODE|
   1    3    3    3 =EOL |\x0a
   2    0    4    4 +MAP |
   2    0    4    4 +PAIR|
   2    0    4    4 +NODE|
   2    0    4    4 +VAL |
   2    0    4    4 =TEXT|nested.sequences
   2   16   20   20 -VAL |
   2   16   20   20 -NODE|
   2   16   20   20 =SYNX|:
   2   17   21   21 +NODE|
   2   17   21   21 =EOL |\x0a
   3    0   22   22 +SEQ |
   3    0   22   22 =SYNX|-
   3    1   23   23 =DENT|.
   3    2   24   24 +NODE|
   3    2   24   24 +SEQ |
   3    2   24   24 =SYNX|-
   3    3   25   25 =DENT|.
   3    4   26   26 +NODE|
   3    4   26   26 +SEQ |
   3    4   26   26 =SYNX|-
   3    5   27   27 =WSPC|.
   3    6   28   28 +NODE|
   3    6   28   28 +SEQ |
   3    6   28   28 =SYNX|[
   3    7   29   29 =SYNX|]
   3    8   30   30 -SEQ |
   3    8   30   30 -NODE|
   3    8   30   30 =EOL |\x0a
   4    0   31   31 -SEQ |
   4    0   31   31 -NODE|
   4    0   31   31 -SEQ |
   4    0   31   31 -NODE|
   4    0   31   31 =SYNX|-
   4    1   32   32 =DENT|.
   4    2   33   33 +NODE|
   4    2   33   33 +SEQ |
   4    2   33   33 =SYNX|-
   4    3   34   34 =DENT|.
   4    4   35   35 +NODE|
   4    4   35   35 +SEQ |
   4    4   35   35 =SYNX|-
   4    5   36   36 =WSPC|.
   4    6   37   37 +NODE|
   4    6   37   37 +MAP |
   4    6   37   37 =SYNX|{
   4    7   38   38 =SYNX|}
   4    8   39   39 -MAP |
   4    8   39   39 -NODE|
   4    8   39   39 =EOL |\x0a
   5    0   40   40 -SEQ |
   5    0   40   40 -NODE|
   5    0   40   40 -SEQ |
   5    0   40   40 -NODE|
   5    0   40   40 -SEQ |
   5    0   40   40 -NODE|
   5    0   40   40 -PAIR|
   5    0   40   40 +PAIR|
   5    0   40   40 +NODE|
   5    0   40   40 +VAL |
   5    0   40   40 =TEXT|key1
   5    4   44   44 -VAL |
   5    4   44   44 -NODE|
   5    4   44   44 =SYNX|:
   5    5   45   45 =WSPC|.
   5    6   46   46 +NODE|
   5    6   46   46 +SEQ |
   5    6   46   46 =SYNX|[
   5    7   47   47 =SYNX|]
   5    8   48   48 -SEQ |
   5    8   48   48 -NODE|
   5    8   48   48 =EOL |\x0a
   6    0   49   49 -PAIR|
   6    0   49   49 +PAIR|
   6    0   49   49 +NODE|
   6    0   49   49 +VAL |
   6    0   49   49 =TEXT|key2
   6    4   53   53 -VAL |
   6    4   53   53 -NODE|
   6    4   53   53 =SYNX|:
   6    5   54   54 =WSPC|.
   6    6   55   55 +NODE|
   6    6   55   55 +MAP |
   6    6   55   55 =SYNX|{
   6    7   56   56 =SYNX|}
   6    8   57   57 -MAP |
   6    8   57   57 -NODE|
   6    8   57   57 =EOL |\x0a
   7    0   58   58 -PAIR|
   7    0   58   58 -MAP |
   7    0   58   58 -NODE|
   7    0   58   58 -DOC |

perl-pp-perl

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

perl-pplibyaml-perl

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

perl-syck-perl

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

perl-xs-perl

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

perl-yaml-perl

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

py-pyyaml-py

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

py-ruamel-py

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

perl-tiny-json

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

perl-tiny-perl

 ni
YAML::Tiny found illegal characters in plain scalar: '- - []' at /yaml/bin/perl-tiny-perl line 15.