# YAML Test Matrix

--- &test-LX3P
  Title: Implicit Flow Mapping Key on one line
  Tags: [ 1.3-err, complex-key, flow, mapping, sequence ]

YAML

[flow]: block

Expected Events

+STR
+DOC
+MAP
+SEQ
=VAL :flow
-SEQ
=VAL :block
-MAP
-DOC
-STR

Expected JSON



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

perl-pp-event

 error
+STR
+DOC
+SEQ
=VAL :flow
-SEQ
Line      : 1
Column    : 7
Expected  : DOC_END DOC_START EOL
Got       : COLON
Where     : /perl5/lib/perl5/YAML/PP/Parser.pm line 386
YAML      : ": block\n"
  at /yaml/bin/perl-pp-event line 25.

perl-pp-perl

 error
Line      : 1
Column    : 7
Expected  : DOC_END DOC_START EOL
Got       : COLON
Where     : /perl5/lib/perl5/YAML/PP/Parser.pm line 386
YAML      : ": block\n"
  at /perl5/lib/perl5/YAML/PP/Loader.pm line 92.

perl-syck-perl

 error
Syck parser (line 1, column 7): syntax error at /perl5/lib/perl5/x86_64-linux-thread-multi/YAML/Syck.pm line 60, <> line 1.

py-pyyaml-py

 error
Traceback (most recent call last):
  File "/yaml/bin/py-pyyaml-py", line 36, in <module>
    for doc in yaml.load_all(sys.stdin.read(), Loader=yaml.FullLoader):
  File "/python/lib/python3.7/site-packages/yaml/__init__.py", line 130, in load_all
    yield loader.get_data()
  File "/python/lib/python3.7/site-packages/yaml/constructor.py", line 45, in get_data
    return self.construct_document(self.get_node())
  File "/python/lib/python3.7/site-packages/yaml/constructor.py", line 60, in construct_document
    for dummy in generator:
  File "/python/lib/python3.7/site-packages/yaml/constructor.py", line 413, in construct_yaml_map
    value = self.construct_mapping(node)
  File "/python/lib/python3.7/site-packages/yaml/constructor.py", line 218, in construct_mapping
    return super().construct_mapping(node, deep=deep)
  File "/python/lib/python3.7/site-packages/yaml/constructor.py", line 142, in construct_mapping
    "found unhashable key", key_node.start_mark)
yaml.constructor.ConstructorError: while constructing a mapping
found unhashable key
  in "<unicode string>", line 1, column 1:
    [flow]: block
    ^

c-libfyaml-json

 na
{
stdin:1:1: error: Non scalar keys are not allowed in JSON emit mode
[flow]: block
^~~~~~

dotnet-yamldotnet-json

 na
{? ["flow"] : "block"}

hs-hsyaml-json

 na
{"[\"flow\"]":"block"}

java-snakeyaml-json

 na
{
  "[flow]": "block"
}

js-jsyaml-json

 na
{"flow":"block"}

js-yaml-json

 na
{
  "[ flow ]": "block"
}

lua-lyaml-json

 na
luajit: /yaml/bin/lua-lyaml-json:8: Cannot serialise table: table key must be a number or string
stack traceback:
	[C]: in function 'encode'
	/yaml/bin/lua-lyaml-json:8: in main chunk
	[C]: at 0x55e84e929f97

perl-pp-json

 na
Line      : 1
Column    : 7
Expected  : DOC_END DOC_START EOL
Got       : COLON
Where     : /perl5/lib/perl5/YAML/PP/Parser.pm line 386
YAML      : ": block\n"
  at /perl5/lib/perl5/YAML/PP/Loader.pm line 92.

perl-pplibyaml-json

 na
{
   "['flow']" : "block"
}

perl-pplibyaml-perl

 na
{
  '[\'flow\']' => 'block'
}

perl-syck-json

 na
Syck parser (line 1, column 7): syntax error at /perl5/lib/perl5/x86_64-linux-thread-multi/YAML/Syck.pm line 60, <> line 1.

perl-tiny-json

 na
{
   "[flow]" : "block"
}

perl-tiny-perl

 na
{
  '[flow]' => 'block'
}

perl-xs-json

 na
{
   "ARRAY(0x562917238968)" : "block"
}

perl-xs-perl

 na
{
  'ARRAY(0x56391bb32b10)' => 'block'
}

perl-yaml-json

 na
{
   "ARRAY(0x562fc1ef2f28)" : "block"
}

perl-yaml-perl

 na
{
  'ARRAY(0x5594b535acb0)' => 'block'
}

py-pyyaml-json

 na
Traceback (most recent call last):
  File "/yaml/bin/py-pyyaml-json", line 19, in <module>
    for doc in yaml.load_all(sys.stdin.read(), Loader=yaml.FullLoader):
  File "/python/lib/python3.7/site-packages/yaml/__init__.py", line 130, in load_all
    yield loader.get_data()
  File "/python/lib/python3.7/site-packages/yaml/constructor.py", line 45, in get_data
    return self.construct_document(self.get_node())
  File "/python/lib/python3.7/site-packages/yaml/constructor.py", line 60, in construct_document
    for dummy in generator:
  File "/python/lib/python3.7/site-packages/yaml/constructor.py", line 413, in construct_yaml_map
    value = self.construct_mapping(node)
  File "/python/lib/python3.7/site-packages/yaml/constructor.py", line 218, in construct_mapping
    return super().construct_mapping(node, deep=deep)
  File "/python/lib/python3.7/site-packages/yaml/constructor.py", line 142, in construct_mapping
    "found unhashable key", key_node.start_mark)
yaml.constructor.ConstructorError: while constructing a mapping
found unhashable key
  in "<unicode string>", line 1, column 1:
    [flow]: block
    ^

py-ruamel-json

 na
{
  
}

py-ruamel-py

 na
{('flow',): 'block'}

ruby-psych-json

 na
{"[\"flow\"]":"block"}