# YAML Test Matrix

--- &test-UDR7
  Title: Spec Example 5.4. Flow Collection Indicators
  Tags: [ flow, mapping, sequence, spec ]

YAML

sequence: [ one, two, ]
mapping: { sky: blue, sea: green }

Expected Events

+STR
+DOC
+MAP
=VAL :sequence
+SEQ
=VAL :one
=VAL :two
-SEQ
=VAL :mapping
+MAP
=VAL :sky
=VAL :blue
=VAL :sea
=VAL :green
-MAP
-MAP
-DOC
-STR

Expected JSON

{
"sequence": [
"one",
"two"
],
"mapping": {
"sky": "blue",
"sea": "green"
}
}

cpp-event

 ok

hs-yaml-event

 ok

java-event

 ok

js-event

 ok

libyaml-event

 ok

nimyaml-event

 ok

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

js-yaml-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

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

perl5-tiny-json

 error
YAML::Tiny found illegal characters in plain scalar: '{ sky: blue, sea: green }' at /bin/perl5-tiny-json line 12.

perl5-tiny-pl

 error
YAML::Tiny found illegal characters in plain scalar: '{ sky: blue, sea: green }' at /bin/perl5-tiny-pl line 15.

perl5-pm-pl

 na
{
  'mapping' => {
               'sea' => 'green',
               'sky' => 'blue'
             },
  'sequence' => [
                'one',
                'two'
              ]
}

perl5-pp-pl

 na
{
  'mapping' => {
               'sea' => 'green',
               'sky' => 'blue'
             },
  'sequence' => [
                'one',
                'two'
              ]
}

perl5-xs-pl

 na
{
  'mapping' => {
                 'sea' => 'green',
                 'sky' => 'blue'
               },
  'sequence' => [
                  'one',
                  'two'
                ]
}

pyyaml-py

 na
{'mapping': {'sea': 'green', 'sky': 'blue'}, 'sequence': ['one', 'two']}

ruamel-py

 na
{'mapping': {'sea': 'green', 'sky': 'blue'}, 'sequence': ['one', 'two']}