# YAML Test Matrix

--- &test-5WE3
  Title: Spec Example 8.17. Explicit Block Mapping Entries
  Tags: [ comment, explicit-key, literal, mapping, sequence, spec ]

YAML

? explicit key # Empty value
? |
  block key
: - one # Explicit compact
  - two # block value

Expected Events

+STR
+DOC
+MAP
=VAL :explicit key
=VAL :
=VAL |block key\n
+SEQ
=VAL :one
=VAL :two
-SEQ
-MAP
-DOC
-STR

Expected JSON

{
"block key\n": [
"one",
"two"
],
"explicit key": null
}

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

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-xs-json

 json_ok

py-pyyaml-json

 json_ok

py-ruamel-json

 json_ok

ruby-psych-json

 json_ok

dotnet-yamldotnet-json

 json_diff
parse error: Invalid numeric literal at line 1, column 25

lua-lyaml-json

 json_diff
{
  "block key\n": [
    "one",
    "two"
  ],
  "explicit key": {}
}

perl-syck-json

 error
Syck parser (line 2, column 2): syntax error at /perl5/lib/perl5/x86_64-linux-thread-multi/YAML/Syck.pm line 60, <> line 1.

perl-syck-perl

 error
Syck parser (line 2, column 2): syntax error at /perl5/lib/perl5/x86_64-linux-thread-multi/YAML/Syck.pm line 60, <> line 1.

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 +NODE|
   1    0    0    0 +MAP |
   1    0    0    0 +PAIR|
   1    0    0    0 =SYNX|?
   1    1    1    1 =WSPC|.
   1    2    2    2 +NODE|
   1    2    2    2 +VAL |
   1    2    2    2 =TEXT|explicit.key
   1   14   14   14 -VAL |
   1   14   14   14 -NODE|
   1   14   14   14 =WSPC|.
   1   15   15   15 +COMM|
   1   15   15   15 =SYNX|#
   1   16   16   16 =META|.Empty.value
   1   28   28   28 -COMM|
   1   28   28   28 =EOL |\x0a
   2    0   29   29 +NODE|
   2    0   29   29 +VAL |
   2    0   29   29 -VAL |
   2    0   29   29 -NODE|
   2    0   29   29 -PAIR|
   2    0   29   29 +PAIR|
   2    0   29   29 =SYNX|?
   2    1   30   30 +NODE|
   2    1   30   30 =WSPC|.
   2    2   31   31 +VAL |
   2    2   31   31 =SYNX||
   2    3   32   32 =EOL |\x0a
   3    0   33   33 =DENT|..
   3    2   35   35 =TEXT|block.key
   3   11   44   44 =NEWL|\x0a
   4    0   45   45 -VAL |
   4    0   45   45 -NODE|
   4    0   45   45 =SYNX|:
   4    1   46   46 =DENT|.
   4    2   47   47 +NODE|
   4    2   47   47 +SEQ |
   4    2   47   47 =SYNX|-
   4    3   48   48 =WSPC|.
   4    4   49   49 +NODE|
   4    4   49   49 +VAL |
   4    4   49   49 =TEXT|one
   4    7   52   52 -VAL |
   4    7   52   52 -NODE|
   4    7   52   52 =WSPC|.
   4    8   53   53 +COMM|
   4    8   53   53 =SYNX|#
   4    9   54   54 =META|.Explicit.compact
   4   26   71   71 -COMM|
   4   26   71   71 =EOL |\x0a
   5    0   72   72 =DENT|..
   5    2   74   74 =SYNX|-
   5    3   75   75 =WSPC|.
   5    4   76   76 +NODE|
   5    4   76   76 +VAL |
   5    4   76   76 =TEXT|two
   5    7   79   79 -VAL |
   5    7   79   79 -NODE|
   5    7   79   79 =WSPC|.
   5    8   80   80 +COMM|
   5    8   80   80 =SYNX|#
   5    9   81   81 =META|.block.value
   5   21   93   93 -COMM|
   5   21   93   93 =EOL |\x0a
   6    0   94   94 -SEQ |
   6    0   94   94 -NODE|
   6    0   94   94 -PAIR|
   6    0   94   94 -MAP |
   6    0   94   94 -NODE|
   6    0   94   94 -DOC |

perl-pp-perl

 na
{
  'block key
' => [
                    'one',
                    'two'
                  ],
  'explicit key' => undef
}

perl-pplibyaml-perl

 na
{
  'block key
' => [
                    'one',
                    'two'
                  ],
  'explicit key' => undef
}

perl-xs-perl

 na
{
  'block key
' => [
                    'one',
                    'two'
                  ],
  'explicit key' => undef
}

py-pyyaml-py

 na
{'block key\n': ['one', 'two'], 'explicit key': None}

py-ruamel-py

 na
{'block key\n': ['one', 'two'], 'explicit key': None}

perl-tiny-json

 ni
YAML::Tiny does not support a feature in line '? explicit key # Empty value' at /yaml/bin/perl-tiny-json line 12.

perl-tiny-perl

 ni
YAML::Tiny does not support a feature in line '? explicit key # Empty value' at /yaml/bin/perl-tiny-perl line 15.