# 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"
}

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

lua-lyaml-json

 json_ok

perl-pp-json

 json_ok

perl-pplibyaml-json

 json_ok

perl-syck-json

 json_ok

perl-xs-json

 json_ok

py-pyyaml-json

 json_ok

py-ruamel-json

 json_ok

ruby-psych-json

 json_ok

perl-yaml-json

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

perl-yaml-perl

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

hs-reference-yeast

 na
Line  Col Char Byte Token|Content
   1    0    0    0 +DOC |
   1    0    0    0 =HEAD|---
   1    3    3    3 =EOL |\x0a
   2    0    4    4 +NODE|
   2    0    4    4 +MAP |
   2    0    4    4 =SYNX|{
   2    1    5    5 =WSPC|.
   2    2    6    6 +PAIR|
   2    2    6    6 +NODE|
   2    2    6    6 +VAL |
   2    2    6    6 =TEXT|top1
   2    6   10   10 -VAL |
   2    6   10   10 -NODE|
   2    6   10   10 =SYNX|:
   2    7   11   11 =WSPC|.
   2    8   12   12 +NODE|
   2    8   12   12 +SEQ |
   2    8   12   12 =SYNX|[
   2    9   13   13 +NODE|
   2    9   13   13 +VAL |
   2    9   13   13 =TEXT|item1
   2   14   18   18 -VAL |
   2   14   18   18 -NODE|
   2   14   18   18 =SYNX|,
   2   15   19   19 =WSPC|.
   2   16   20   20 +NODE|
   2   16   20   20 +MAP |
   2   16   20   20 =SYNX|{
   2   17   21   21 +PAIR|
   2   17   21   21 +NODE|
   2   17   21   21 +VAL |
   2   17   21   21 =TEXT|key2
   2   21   25   25 -VAL |
   2   21   25   25 -NODE|
   2   21   25   25 =SYNX|:
   2   22   26   26 =WSPC|.
   2   23   27   27 +NODE|
   2   23   27   27 +VAL |
   2   23   27   27 =TEXT|value2
   2   29   33   33 -VAL |
   2   29   33   33 -NODE|
   2   29   33   33 -PAIR|
   2   29   33   33 =SYNX|}
   2   30   34   34 -MAP |
   2   30   34   34 -NODE|
   2   30   34   34 =SYNX|,
   2   31   35   35 =WSPC|.
   2   32   36   36 +NODE|
   2   32   36   36 +VAL |
   2   32   36   36 =TEXT|item3
   2   37   41   41 -VAL |
   2   37   41   41 -NODE|
   2   37   41   41 =SYNX|]
   2   38   42   42 -SEQ |
   2   38   42   42 -NODE|
   2   38   42   42 -PAIR|
   2   38   42   42 =SYNX|,
   2   39   43   43 =WSPC|.
   2   40   44   44 +PAIR|
   2   40   44   44 +NODE|
   2   40   44   44 +VAL |
   2   40   44   44 =TEXT|top2
   2   44   48   48 -VAL |
   2   44   48   48 -NODE|
   2   44   48   48 =SYNX|:
   2   45   49   49 =WSPC|.
   2   46   50   50 +NODE|
   2   46   50   50 +VAL |
   2   46   50   50 =TEXT|value2
   2   52   56   56 -VAL |
   2   52   56   56 -NODE|
   2   52   56   56 -PAIR|
   2   52   56   56 =WSPC|.
   2   53   57   57 =SYNX|}
   2   54   58   58 -MAP |
   2   54   58   58 -NODE|
   2   54   58   58 =EOL |\x0a
   3    0   59   59 -DOC |

perl-pp-perl

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

perl-pplibyaml-perl

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

perl-syck-perl

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

perl-xs-perl

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

py-pyyaml-py

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

py-ruamel-py

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

perl-tiny-json

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

perl-tiny-perl

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