# YAML Test Matrix

--- &test-E76Z
  Title: Aliases in Implicit Block Mapping
  Tags: [ alias, mapping ]

YAML

&a a: &b b
*a : *b

Expected Events

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

Expected JSON

{
"a": "b"
}

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

java-json

 json_ok

js-json

 json_ok

luajit-json

 json_ok

perl5-pm-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

perl5-syck-json

 json_diff
{
  "YAML::Syck::BadAlias=HASH(0x14ff170)": "b",
  "a": "b"
}

js-yaml-json

 error
YAMLException: end of the stream or a document separator is expected at line 1, column 5:
    &a a: &b b
        ^
    at generateError (/node_modules/js-yaml/lib/js-yaml/loader.js:165:10)
    at throwError (/node_modules/js-yaml/lib/js-yaml/loader.js:171:9)
    at readDocument (/node_modules/js-yaml/lib/js-yaml/loader.js:1512:5)
    at loadDocuments (/node_modules/js-yaml/lib/js-yaml/loader.js:1548:5)
    at Object.loadAll (/node_modules/js-yaml/lib/js-yaml/loader.js:1556:19)
    at Object.<anonymous> (/bin/js-yaml-json:6:6)
    at Object.<anonymous> (/bin/js-yaml-json:3:1)
    at Module._compile (module.js:652:30)
    at Object.exports.run (/usr/lib/node_modules/coffee-script/lib/coffee-script/coffee-script.js:173:23)
    at compileScript (/usr/lib/node_modules/coffee-script/lib/coffee-script/command.js:224:29)
    at compilePath (/usr/lib/node_modules/coffee-script/lib/coffee-script/command.js:174:14)
    at Object.exports.run (/usr/lib/node_modules/coffee-script/lib/coffee-script/command.js:98:20)
    at Object.<anonymous> (/usr/lib/node_modules/coffee-script/bin/coffee:15:45)
    at Module._compile (module.js:652:30)
    at Object.Module._extensions..js (module.js:663:10)
    at Module.load (module.js:565:32)
    at tryModuleLoad (module.js:505:12)
    at Function.Module._load (module.js:497:3)
    at Function.Module.runMain (module.js:693:10)
    at startup (bootstrap_node.js:191:16)
    at bootstrap_node.js:612:3

perl5-pegex-event

 error
Error parsing Pegex document:
  msg:      Parse document failed for some reason
  line:     2
  column:   1
  context:  *a : *b\n
            ^
  position: 11 (0 pre-lookahead)
 at /bin/perl5-pegex-event line 23.

perl5-tiny-json

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

perl5-tiny-pl

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

perl5-pm-pl

 na
{
  'a' => 'b'
}

perl5-pp-pl

 na
{
  'a' => 'b'
}

perl5-syck-pl

 na
{
  'YAML::Syck::BadAlias=HASH(0x2267bf8)' => 'b',
  'a' => 'b'
}

perl5-xs-pl

 na
{
  'a' => 'b'
}

pyyaml-py

 na
{'a': 'b'}

ruamel-py

 na
{'a': 'b'}
/usr/local/lib/python2.7/dist-packages/ruamel/yaml/constructor.py:276: DuplicateKeyFutureWarning: while constructing a mapping
found duplicate key "a" with value "b" (original value: "b")
  in "<byte string>", line 1, column 1:
    &a a: &b b
    ^ (line: 1)

To suppress this check see:
    http://yaml.readthedocs.io/en/latest/api.html#duplicate-keys

Duplicate keys will become an error in future releases, and are errors
by default when using the new API.

  warnings.warn(DuplicateKeyFutureWarning(*args))