# YAML Test Matrix

--- &test-ZWK4
  Title: Key with anchor after missing explicit mapping value
  Tags: [ anchor, 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
}

cpp-event

 ok

hs-yaml-event

 ok

java-event

 ok

js-event

 ok

libyaml-event

 ok

nimyaml-event

 ok

perl5-pp-event

 ok

pyyaml-event

 ok

ruamel-event

 ok

hs-yaml-json

 json_ok

js-json

 json_ok

js-yaml-json

 json_ok

perl5-pp-json

 json_ok

perl5-xs-json

 json_ok

pyyaml-json

 json_ok

ruamel-json

 json_ok

ruby-json

 json_ok

java-json

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

luajit-json

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

perl5-pegex-event

 error
Maximum parsing rules reached (1000)

perl5-pm-json

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

perl5-pm-pl

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

perl5-syck-json

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

perl5-syck-pl

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

perl5-tiny-json

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

perl5-tiny-pl

 error
YAML::Tiny does not support a feature in line '? b' at /bin/perl5-tiny-pl line 15.

perl5-pp-pl

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

perl5-xs-pl

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

pyyaml-py

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

ruamel-py

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