# YAML Test Matrix

--- &test-CN3R
  Title: Various location of anchors in flow sequence
  Tags: [ anchor, flow, mapping, sequence ]

YAML

&flowseq [
 a: b,
 &c c: d,
 { &e e: f },
 &g { g: h }
]

Expected Events

+STR
+DOC
+SEQ &flowseq
+MAP
=VAL :a
=VAL :b
-MAP
+MAP
=VAL &c :c
=VAL :d
-MAP
+MAP
=VAL &e :e
=VAL :f
-MAP
+MAP &g
=VAL :g
=VAL :h
-MAP
-SEQ
-DOC
-STR

Expected JSON

[
{
"a": "b"
},
{
"c": "d"
},
{
"e": "f"
},
{
"g": "h"
}
]

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-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-jsyaml-json

 json_ok

js-yaml-json

 json_ok

lua-lyaml-json

 json_ok

perl-pplibyaml-json

 json_ok

perl-syck-json

 json_ok

perl-xs-json

 json_ok

py-pyyaml-json

 json_ok

py-ruamel-json

 json_ok

ruby-psych-json

 json_ok

perl-pp-event

 error
+STR
+DOC
+SEQ &flowseq
=VAL :a
Line      : 2
Column    : 3
Expected  : EOL FLOWSEQ_END FLOW_COMMA WS
Got       : COLON
Where     : /perl5/lib/perl5/YAML/PP/Parser.pm line 386
YAML      : ": b,\n"
  at /yaml/bin/perl-pp-event line 25.

perl-pp-json

 error
Line      : 2
Column    : 3
Expected  : EOL FLOWSEQ_END FLOW_COMMA WS
Got       : COLON
Where     : /perl5/lib/perl5/YAML/PP/Parser.pm line 386
YAML      : ": b,\n"
  at /perl5/lib/perl5/YAML/PP/Loader.pm line 92.

perl-pp-perl

 error
Line      : 2
Column    : 3
Expected  : EOL FLOWSEQ_END FLOW_COMMA WS
Got       : COLON
Where     : /perl5/lib/perl5/YAML/PP/Parser.pm line 386
YAML      : ": b,\n"
  at /perl5/lib/perl5/YAML/PP/Loader.pm line 92.

perl-yaml-json

 error
YAML Error: Expected separator '---'
   Code: YAML_PARSE_ERR_NO_SEPARATOR
   Line: 1
   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: 1
   Document: 2
 at /perl5/lib/perl5/YAML/Loader.pm line 88.

perl-pplibyaml-perl

 na
[
  {
    'a' => 'b'
  },
  {
    'c' => 'd'
  },
  {
    'e' => 'f'
  },
  {
    'g' => 'h'
  }
]

perl-syck-perl

 na
[
  {
    'a' => 'b'
  },
  {
    'c' => 'd'
  },
  {
    'e' => 'f'
  },
  {
    'g' => 'h'
  }
]

perl-xs-perl

 na
[
  {
    'a' => 'b'
  },
  {
    'c' => 'd'
  },
  {
    'e' => 'f'
  },
  {
    'g' => 'h'
  }
]

py-pyyaml-py

 na
[{'a': 'b'}, {'c': 'd'}, {'e': 'f'}, {'g': 'h'}]

py-ruamel-py

 na
[{'a': 'b'}, {'c': 'd'}, {'e': 'f'}, {'g': 'h'}]

perl-tiny-json

 ni
YAML::Tiny failed to classify line '&flowseq [' at /yaml/bin/perl-tiny-json line 12.

perl-tiny-perl

 ni
YAML::Tiny failed to classify line '&flowseq [' at /yaml/bin/perl-tiny-perl line 15.