# YAML Test Matrix

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

YAML

[flow]: block

Expected Events

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

Expected JSON



cpp-event

 ok

hs-yaml-event

 ok

java-event

 ok

js-event

 ok

libyaml-event

 ok

nimyaml-event

 ok

pyyaml-event

 ok

ruamel-event

 ok

perl5-pegex-event

 diff
Got Events:
+STR
+DOC
+SEQ
=VAL :flow
-SEQ
-DOC
+DOC
+MAP
=VAL :
=VAL :block
-MAP
-DOC
-STR

perl5-pp-event

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

perl5-pp-pl

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

perl5-syck-pl

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

pyyaml-py

 error
Traceback (most recent call last):
  File "/bin/pyyaml-py", line 36, in <module>
    for doc in yaml.load_all(sys.stdin.read(), Loader=yaml.FullLoader):
  File "/lib/python2.7/site-packages/yaml/__init__.py", line 130, in load_all
    yield loader.get_data()
  File "/lib/python2.7/site-packages/yaml/constructor.py", line 39, in get_data
    return self.construct_document(self.get_node())
  File "/lib/python2.7/site-packages/yaml/constructor.py", line 54, in construct_document
    for dummy in generator:
  File "/lib/python2.7/site-packages/yaml/constructor.py", line 404, in construct_yaml_map
    value = self.construct_mapping(node)
  File "/lib/python2.7/site-packages/yaml/constructor.py", line 214, in construct_mapping
    return BaseConstructor.construct_mapping(self, node, deep=deep)
  File "/lib/python2.7/site-packages/yaml/constructor.py", line 138, in construct_mapping
    "found unacceptable key (%s)" % exc, key_node.start_mark)
yaml.constructor.ConstructorError: while constructing a mapping
found unacceptable key (unhashable type: 'list')
  in "<string>", line 1, column 1:
    [flow]: block
    ^

hs-yaml-json

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

java-json

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

js-json

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

js-yaml-json

 na
{
  "flow": "block"
}

luajit-json

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

perl5-pm-json

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

perl5-pm-pl

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

perl5-pp-json

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

perl5-syck-json

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

perl5-tiny-json

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

perl5-tiny-pl

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

perl5-xs-json

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

perl5-xs-pl

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

pyyaml-json

 na
Traceback (most recent call last):
  File "/bin/pyyaml-json", line 19, in <module>
    for doc in yaml.load_all(sys.stdin.read(), Loader=yaml.FullLoader):
  File "/lib/python2.7/site-packages/yaml/__init__.py", line 130, in load_all
    yield loader.get_data()
  File "/lib/python2.7/site-packages/yaml/constructor.py", line 39, in get_data
    return self.construct_document(self.get_node())
  File "/lib/python2.7/site-packages/yaml/constructor.py", line 54, in construct_document
    for dummy in generator:
  File "/lib/python2.7/site-packages/yaml/constructor.py", line 404, in construct_yaml_map
    value = self.construct_mapping(node)
  File "/lib/python2.7/site-packages/yaml/constructor.py", line 214, in construct_mapping
    return BaseConstructor.construct_mapping(self, node, deep=deep)
  File "/lib/python2.7/site-packages/yaml/constructor.py", line 138, in construct_mapping
    "found unacceptable key (%s)" % exc, key_node.start_mark)
yaml.constructor.ConstructorError: while constructing a mapping
found unacceptable key (unhashable type: 'list')
  in "<string>", line 1, column 1:
    [flow]: block
    ^

ruamel-json

 na
{
  
}

ruamel-py

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

ruby-json

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