# 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
Expected document end at /lib/perl5/YAML/PP/Parser.pm line 550, <> line 1.
 at /bin/perl5-pp-event line 19.

perl5-pp-pl

 error
Expected document end at /lib/perl5/YAML/PP/Parser.pm line 550, <> line 1.
 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()):
  File "/lib/python2.7/site-packages/yaml/__init__.py", line 90, in load_all
    yield loader.get_data()
  File "/lib/python2.7/site-packages/yaml/constructor.py", line 33, in get_data
    return self.construct_document(self.get_node())
  File "/lib/python2.7/site-packages/yaml/constructor.py", line 48, in construct_document
    for dummy in generator:
  File "/lib/python2.7/site-packages/yaml/constructor.py", line 398, in construct_yaml_map
    value = self.construct_mapping(node)
  File "/lib/python2.7/site-packages/yaml/constructor.py", line 208, in construct_mapping
    return BaseConstructor.construct_mapping(self, node, deep=deep)
  File "/lib/python2.7/site-packages/yaml/constructor.py", line 132, 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(0x241be60)" : "block"
}

perl5-pm-pl

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

perl5-pp-json

 na
Expected document end at /lib/perl5/YAML/PP/Parser.pm line 550, <> line 1.
 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(0x2056930)" : "block"
}

perl5-xs-pl

 na
{
  'ARRAY(0x277d5c8)' => '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()):
  File "/lib/python2.7/site-packages/yaml/__init__.py", line 90, in load_all
    yield loader.get_data()
  File "/lib/python2.7/site-packages/yaml/constructor.py", line 33, in get_data
    return self.construct_document(self.get_node())
  File "/lib/python2.7/site-packages/yaml/constructor.py", line 48, in construct_document
    for dummy in generator:
  File "/lib/python2.7/site-packages/yaml/constructor.py", line 398, in construct_yaml_map
    value = self.construct_mapping(node)
  File "/lib/python2.7/site-packages/yaml/constructor.py", line 208, in construct_mapping
    return BaseConstructor.construct_mapping(self, node, deep=deep)
  File "/lib/python2.7/site-packages/yaml/constructor.py", line 132, 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"}