# YAML Test Matrix

--- &test-6KGN
  Title: Anchor for empty node
  Tags: [ alias, anchor ]

YAML

---
a: &anchor
b: *anchor

Expected Events

+STR
+DOC ---
+MAP
=VAL :a
=VAL &anchor :
=VAL :b
=ALI *anchor
-MAP
-DOC
-STR

Expected JSON

{
"a": null,
"b": null
}

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

perl5-pp-json

 json_ok

perl5-syck-json

 json_ok

pyyaml-json

 json_ok

ruamel-json

 json_ok

ruby-json

 json_ok

perl5-pegex-event

 diff
Got Events:
+STR
+DOC ---
+MAP
=VAL :a
=VAL &anchor :b
=VAL :
=ALI *anchor
-MAP
-DOC
-STR

java-json

 json_diff
{}

js-yaml-json

 json_diff
{
  "a": null,
  "b": []
}

luajit-json

 json_diff
{
  "a": "",
  "b": ""
}

perl5-pm-json

 error
YAML Error: No anchor for alias '*anchor'
   Code: YAML_PARSE_ERR_NO_ANCHOR
   Line: 3
   Document: 1
 at /lib/perl5/YAML/Loader.pm line 152.

perl5-pm-pl

 error
YAML Error: No anchor for alias '*anchor'
   Code: YAML_PARSE_ERR_NO_ANCHOR
   Line: 3
   Document: 1
 at /lib/perl5/YAML/Loader.pm line 152.

perl5-tiny-json

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

perl5-tiny-pl

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

perl5-xs-json

 error
YAML::XS Error: No anchor for alias 'anchor' at /bin/perl5-xs-json line 14, <> line 1.

perl5-xs-pl

 error
YAML::XS Error: No anchor for alias 'anchor' at /bin/perl5-xs-pl line 16, <> line 1.

perl5-pp-pl

 na
{
  'a' => undef,
  'b' => undef
}

perl5-syck-pl

 na
{
  'a' => undef,
  'b' => undef
}

pyyaml-py

 na
{'a': None, 'b': None}

ruamel-py

 na
{'a': None, 'b': None}