# 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-yamlcpp-event

 ok

dotnet-yamldotnet-event

 ok

hs-hsyaml-event

 ok

java-snakeyaml-event

 ok

js-yaml-event

 ok

nim-nimyaml-event

 ok

perl-pp-event

 ok

perl-pplibyaml-event

 ok

py-pyyaml-event

 ok

py-ruamel-event

 ok

c-libfyaml-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

java-snakeyaml-json

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

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.

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.