# YAML Test Matrix

--- &test-ZWK4
  Title: Key with anchor after missing explicit mapping value
  Tags: [ anchor, explicit-key, mapping ]

YAML

---
a: 1
? b
&anchor c: 3

Expected Events

+STR
+DOC ---
+MAP
=VAL :a
=VAL :1
=VAL :b
=VAL :
=VAL &anchor :c
=VAL :3
-MAP
-DOC
-STR

Expected JSON

{
"a": 1,
"b": null,
"c": 3
}

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
{
  "a": "1",
  "b": null,
  "c": "3"
}

java-snakeyaml-json

 json_diff
{
  "a": 1,
  "c": 3
}

lua-lyaml-json

 json_diff
{
  "a": 1,
  "b": {},
  "c": 3
}

perl-syck-json

 error
Syck parser (line 4, column 7): 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 4, column 7): 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: 4
   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: 4
   Document: 1
 at /perl5/lib/perl5/YAML/Loader.pm line 360.

perl-pp-perl

 na
{
  'a' => 1,
  'b' => undef,
  'c' => 3
}

perl-pplibyaml-perl

 na
{
  'a' => 1,
  'b' => undef,
  'c' => 3
}

perl-xs-perl

 na
{
  'a' => 1,
  'b' => undef,
  'c' => 3
}

py-pyyaml-py

 na
{'a': 1, 'b': None, 'c': 3}

py-ruamel-py

 na
{'a': 1, 'b': None, 'c': 3}

perl-tiny-json

 ni
YAML::Tiny does not support a feature in line '? b' at /yaml/bin/perl-tiny-json line 12.

perl-tiny-perl

 ni
YAML::Tiny does not support a feature in line '? b' at /yaml/bin/perl-tiny-perl line 15.