# YAML Test Matrix

--- &test-HMQ5
  Title: Spec Example 6.23. Node Properties
  Tags: [ alias, spec, tag ]

YAML

!!str &a1 "foo":
  !!str bar
&a2 baz : *a1

Expected Events

+STR
+DOC
+MAP
=VAL &a1 <tag:yaml.org,2002:str> "foo
=VAL <tag:yaml.org,2002:str> :bar
=VAL &a2 :baz
=ALI *a1
-MAP
-DOC
-STR

Expected JSON

{
"baz": "foo",
"foo": "bar"
}

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

dotnet-yamldotnet-json

 json_ok

hs-hsyaml-json

 json_ok

java-snakeyaml-json

 json_ok

js-yaml-json

 json_ok

lua-lyaml-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

perl-syck-json

 json_diff
{
  "baz": {
    "name": "a1"
  },
  "foo": "bar"
}

js-jsyaml-json

 error
/node/node_modules/js-yaml/lib/js-yaml/loader.js:173
  throw generateError(state, message);
  ^
YAMLException: end of the stream or a document separator is expected at line 1, column 16:
    !!str &a1 "foo":
                   ^
    at generateError (/node/node_modules/js-yaml/lib/js-yaml/loader.js:167:10)
    at throwError (/node/node_modules/js-yaml/lib/js-yaml/loader.js:173:9)
    at readDocument (/node/node_modules/js-yaml/lib/js-yaml/loader.js:1539:5)
    at loadDocuments (/node/node_modules/js-yaml/lib/js-yaml/loader.js:1575:5)
    at Object.loadAll (/node/node_modules/js-yaml/lib/js-yaml/loader.js:1583:19)
    at Object.<anonymous> (/yaml/bin/js-jsyaml-json:7:13)
    at Module._compile (internal/modules/cjs/loader.js:778:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
    at Module.load (internal/modules/cjs/loader.js:653:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:593:12)

perl-yaml-json

 error
YAML Error: Expected separator '---'
   Code: YAML_PARSE_ERR_NO_SEPARATOR
   Line: 2
   Document: 2
 at /perl5/lib/perl5/YAML/Loader.pm line 88.

perl-yaml-perl

 error
YAML Error: Expected separator '---'
   Code: YAML_PARSE_ERR_NO_SEPARATOR
   Line: 2
   Document: 2
 at /perl5/lib/perl5/YAML/Loader.pm line 88.

perl-pp-perl

 na
{
  'baz' => 'foo',
  'foo' => 'bar'
}

perl-pplibyaml-perl

 na
{
  'baz' => 'foo',
  'foo' => 'bar'
}

perl-syck-perl

 na
{
  'baz' => {
             'name' => 'a1'
           },
  'foo' => 'bar'
}

perl-xs-perl

 na
{
  'baz' => 'foo',
  'foo' => 'bar'
}

py-pyyaml-py

 na
{'baz': 'foo', 'foo': 'bar'}

py-ruamel-py

 na
{'baz': 'foo', 'foo': 'bar'}

perl-tiny-json

 ni
YAML::Tiny failed to classify line '  !!str bar' at /yaml/bin/perl-tiny-json line 12.

perl-tiny-perl

 ni
YAML::Tiny failed to classify line '  !!str bar' at /yaml/bin/perl-tiny-perl line 15.