# YAML Test Matrix

--- &test-CFD4
  Title: Empty implicit key in single pair flow sequences
  Tags: [ empty-key, flow, sequence ]

YAML

- [ : empty key ]
- [: another empty key]

Expected Events

+STR
+DOC
+SEQ
+SEQ
+MAP
=VAL :
=VAL :empty key
-MAP
-SEQ
+SEQ
+MAP
=VAL :
=VAL :another empty key
-MAP
-SEQ
-SEQ
-DOC
-STR

Expected JSON



c-libfyaml-event

 ok

cpp-yamlcpp-event

 ok

dotnet-yamldotnet-event

 ok

hs-hsyaml-event

 ok

js-yaml-event

 ok

nim-nimyaml-event

 ok

perl-pp-event

 error
+STR
+DOC
+SEQ
+SEQ
Line      : 1
Column    : 5
Expected  : ALIAS FLOWMAP_START FLOWSEQ_START PLAIN PLAIN_MULTI QUOTED QUOTED_MULTILINE
Got       : COLON
Where     : /perl5/lib/perl5/YAML/PP/Parser.pm line 386
YAML      : ": empty key ]\n"
  at /yaml/bin/perl-pp-event line 25.

perl-pp-perl

 error
Line      : 1
Column    : 5
Expected  : ALIAS FLOWMAP_START FLOWSEQ_START PLAIN PLAIN_MULTI QUOTED QUOTED_MULTILINE
Got       : COLON
Where     : /perl5/lib/perl5/YAML/PP/Parser.pm line 386
YAML      : ": empty key ]\n"
  at /perl5/lib/perl5/YAML/PP/Loader.pm line 92.

perl-syck-perl

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

perl-yaml-perl

 error
YAML Error: Can't parse inline sequence
   Code: YAML_PARSE_ERR_INLINE_SEQUENCE
   Line: 2
   Document: 1
 at /perl5/lib/perl5/YAML/Loader.pm line 551.

py-ruamel-event

 error
+STR
+DOC
+SEQ
+SEQ
Traceback (most recent call last):
  File "/yaml/bin/py-ruamel-event", line 7, in <module>
    for event in ruamel.yaml.parse(sys.stdin.read()):
  File "/python/lib/python3.7/site-packages/ruamel/yaml/main.py", line 907, in parse
    while loader._parser.check_event():
  File "/python/lib/python3.7/site-packages/ruamel/yaml/parser.py", line 140, in check_event
    self.current_event = self.state()
  File "/python/lib/python3.7/site-packages/ruamel/yaml/parser.py", line 642, in parse_flow_sequence_first_entry
    return self.parse_flow_sequence_entry(first=True)
  File "/python/lib/python3.7/site-packages/ruamel/yaml/parser.py", line 668, in parse_flow_sequence_entry
    return self.parse_flow_node()
  File "/python/lib/python3.7/site-packages/ruamel/yaml/parser.py", line 333, in parse_flow_node
    return self.parse_node()
  File "/python/lib/python3.7/site-packages/ruamel/yaml/parser.py", line 493, in parse_node
    token.start_mark,
ruamel.yaml.parser.ParserError: while parsing a flow node
expected the node content, but found ':'
  in "<unicode string>", line 1, column 5:
    - [ : empty key ]
        ^ (line: 1)

py-ruamel-py

 error
Traceback (most recent call last):
  File "/yaml/bin/py-ruamel-py", line 36, in <module>
    for doc in ruamel.yaml.load_all(sys.stdin.read(), Loader=ruamel.yaml.Loader):
  File "/python/lib/python3.7/site-packages/ruamel/yaml/main.py", line 976, in load_all
    yield loader._constructor.get_data()
  File "/python/lib/python3.7/site-packages/ruamel/yaml/constructor.py", line 106, in get_data
    return self.construct_document(self.composer.get_node())
  File "/python/lib/python3.7/site-packages/ruamel/yaml/composer.py", line 68, in get_node
    return self.compose_document()
  File "/python/lib/python3.7/site-packages/ruamel/yaml/composer.py", line 101, in compose_document
    node = self.compose_node(None, None)
  File "/python/lib/python3.7/site-packages/ruamel/yaml/composer.py", line 136, in compose_node
    node = self.compose_sequence_node(anchor)
  File "/python/lib/python3.7/site-packages/ruamel/yaml/composer.py", line 180, in compose_sequence_node
    node.value.append(self.compose_node(node, index))
  File "/python/lib/python3.7/site-packages/ruamel/yaml/composer.py", line 136, in compose_node
    node = self.compose_sequence_node(anchor)
  File "/python/lib/python3.7/site-packages/ruamel/yaml/composer.py", line 179, in compose_sequence_node
    while not self.parser.check_event(SequenceEndEvent):
  File "/python/lib/python3.7/site-packages/ruamel/yaml/parser.py", line 140, in check_event
    self.current_event = self.state()
  File "/python/lib/python3.7/site-packages/ruamel/yaml/parser.py", line 642, in parse_flow_sequence_first_entry
    return self.parse_flow_sequence_entry(first=True)
  File "/python/lib/python3.7/site-packages/ruamel/yaml/parser.py", line 668, in parse_flow_sequence_entry
    return self.parse_flow_node()
  File "/python/lib/python3.7/site-packages/ruamel/yaml/parser.py", line 333, in parse_flow_node
    return self.parse_node()
  File "/python/lib/python3.7/site-packages/ruamel/yaml/parser.py", line 493, in parse_node
    token.start_mark,
ruamel.yaml.parser.ParserError: while parsing a flow node
expected the node content, but found ':'
  in "<unicode string>", line 1, column 5:
    - [ : empty key ]
        ^ (line: 1)

c-libfyaml-json

 na
[
  [
    {
      "": "empty key"
    }
  ],
  [
    {
      "": "another empty key"
    }
  ]
]

dotnet-yamldotnet-json

 na
Unhandled exception. YamlDotNet.Core.YamlException: (Line: 1, Col: 1, Idx: 0) - (Line: 1, Col: 1, Idx: 0): Exception during deserialization
 ---> System.ArgumentNullException: Value cannot be null. (Parameter 'key')
   at System.Collections.Generic.Dictionary`2.System.Collections.IDictionary.set_Item(Object key, Object value)
   at YamlDotNet.Serialization.NodeDeserializers.DictionaryNodeDeserializer.DeserializeHelper(Type tKey, Type tValue, IParser parser, Func`3 nestedObjectDeserializer, IDictionary result)
   at YamlDotNet.Serialization.NodeDeserializers.DictionaryNodeDeserializer.YamlDotNet.Serialization.INodeDeserializer.Deserialize(IParser parser, Type expectedType, Func`3 nestedObjectDeserializer, Object& value)
   at YamlDotNet.Serialization.ValueDeserializers.NodeValueDeserializer.DeserializeValue(IParser parser, Type expectedType, SerializerState state, IValueDeserializer nestedObjectDeserializer)
   --- End of inner exception stack trace ---
   at YamlDotNet.Serialization.ValueDeserializers.NodeValueDeserializer.DeserializeValue(IParser parser, Type expectedType, SerializerState state, IValueDeserializer nestedObjectDeserializer)
   at YamlDotNet.Serialization.ValueDeserializers.AliasValueDeserializer.DeserializeValue(IParser parser, Type expectedType, SerializerState state, IValueDeserializer nestedObjectDeserializer)
   at YamlDotNet.Serialization.ValueDeserializers.NodeValueDeserializer.<>c__DisplayClass3_0.<DeserializeValue>b__0(IParser r, Type t)
   at YamlDotNet.Serialization.NodeDeserializers.CollectionNodeDeserializer.DeserializeHelper(Type tItem, IParser parser, Func`3 nestedObjectDeserializer, IList result, Boolean canUpdate)
   at YamlDotNet.Serialization.NodeDeserializers.CollectionNodeDeserializer.YamlDotNet.Serialization.INodeDeserializer.Deserialize(IParser parser, Type expectedType, Func`3 nestedObjectDeserializer, Object& value)
   at YamlDotNet.Serialization.ValueDeserializers.NodeValueDeserializer.DeserializeValue(IParser parser, Type expectedType, SerializerState state, IValueDeserializer nestedObjectDeserializer)
   at YamlDotNet.Serialization.ValueDeserializers.AliasValueDeserializer.DeserializeValue(IParser parser, Type expectedType, SerializerState state, IValueDeserializer nestedObjectDeserializer)
   at YamlDotNet.Serialization.ValueDeserializers.NodeValueDeserializer.<>c__DisplayClass3_0.<DeserializeValue>b__0(IParser r, Type t)
   at YamlDotNet.Serialization.NodeDeserializers.CollectionNodeDeserializer.DeserializeHelper(Type tItem, IParser parser, Func`3 nestedObjectDeserializer, IList result, Boolean canUpdate)
   at YamlDotNet.Serialization.NodeDeserializers.CollectionNodeDeserializer.YamlDotNet.Serialization.INodeDeserializer.Deserialize(IParser parser, Type expectedType, Func`3 nestedObjectDeserializer, Object& value)
   at YamlDotNet.Serialization.ValueDeserializers.NodeValueDeserializer.DeserializeValue(IParser parser, Type expectedType, SerializerState state, IValueDeserializer nestedObjectDeserializer)
   at YamlDotNet.Serialization.ValueDeserializers.AliasValueDeserializer.DeserializeValue(IParser parser, Type expectedType, SerializerState state, IValueDeserializer nestedObjectDeserializer)
   at YamlDotNet.Serialization.Deserializer.Deserialize(IParser parser, Type type)
   at YamlDotNet.Serialization.Deserializer.Deserialize(TextReader input, Type type)
   at YamlDotNet.Serialization.Deserializer.Deserialize(TextReader input)
   at Program.Main(String[] commandLineArguments)
Aborted (core dumped)

hs-hsyaml-json

 na
[[{"":"empty key"}],[{"":"another empty key"}]]

java-snakeyaml-json

 na
Exception in thread "main" while parsing a flow node
 in 'reader', line 1, column 5:
    - [ : empty key ]
        ^
expected the node content, but found ':'
 in 'reader', line 1, column 5:
    - [ : empty key ]
        ^

	at org.yaml.snakeyaml.parser.ParserImpl.parseNode(ParserImpl.java:482)
	at org.yaml.snakeyaml.parser.ParserImpl.parseFlowNode(ParserImpl.java:364)
	at org.yaml.snakeyaml.parser.ParserImpl.access$2400(ParserImpl.java:117)
	at org.yaml.snakeyaml.parser.ParserImpl$ParseFlowSequenceEntry.produce(ParserImpl.java:648)
	at org.yaml.snakeyaml.parser.ParserImpl$ParseFlowSequenceFirstEntry.produce(ParserImpl.java:617)
	at org.yaml.snakeyaml.parser.ParserImpl.peekEvent(ParserImpl.java:158)
	at org.yaml.snakeyaml.parser.ParserImpl.checkEvent(ParserImpl.java:148)
	at org.yaml.snakeyaml.composer.Composer.composeSequenceNode(Composer.java:208)
	at org.yaml.snakeyaml.composer.Composer.composeNode(Composer.java:160)
	at org.yaml.snakeyaml.composer.Composer.composeSequenceNode(Composer.java:209)
	at org.yaml.snakeyaml.composer.Composer.composeNode(Composer.java:160)
	at org.yaml.snakeyaml.composer.Composer.getNode(Composer.java:95)
	at org.yaml.snakeyaml.constructor.BaseConstructor.getData(BaseConstructor.java:134)
	at org.yaml.snakeyaml.Yaml$1.next(Yaml.java:494)
	at org.yaml.editor.Snake2Json.yamlToJson(Snake2Json.java:18)
	at org.yaml.editor.Snake2Json.main(Snake2Json.java:25)

js-jsyaml-json

 na
[[{"null":"empty key"}],[{"null":"another empty key"}]]

js-yaml-json

 na
[
  [
    {
      "": "empty key"
    }
  ],
  [
    {
      "": "another empty key"
    }
  ]
]

lua-lyaml-json

 na
luajit: 1:3: did not find expected node content
stack traceback:
	[C]: in function 'error'
	/usr/local/share/lua/5.1/lyaml/init.lua:291: in function 'error'
	/usr/local/share/lua/5.1/lyaml/init.lua:310: in function 'parse'
	/usr/local/share/lua/5.1/lyaml/init.lua:428: in function 'load_node'
	/usr/local/share/lua/5.1/lyaml/init.lua:378: in function 'load_node'
	/usr/local/share/lua/5.1/lyaml/init.lua:378: in function 'load_node'
	/usr/local/share/lua/5.1/lyaml/init.lua:482: in function 'load'
	/yaml/bin/lua-lyaml-json:6: in main chunk
	[C]: at 0x56423be5bf97

perl-pp-json

 na
Line      : 1
Column    : 5
Expected  : ALIAS FLOWMAP_START FLOWSEQ_START PLAIN PLAIN_MULTI QUOTED QUOTED_MULTILINE
Got       : COLON
Where     : /perl5/lib/perl5/YAML/PP/Parser.pm line 386
YAML      : ": empty key ]\n"
  at /perl5/lib/perl5/YAML/PP/Loader.pm line 92.

perl-pplibyaml-json

 na
YAML::PP::LibYAML Error: The problem:

    did not find expected node content

was found at , line: 1, column: 5
while parsing a flow node at line: 1, column: 5

perl-syck-json

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

perl-tiny-json

 na
[
   {
      "[" : "empty key ]"
   },
   {
      "[" : "another empty key]"
   }
]

perl-tiny-perl

 na
[
  {
    '[' => 'empty key ]'
  },
  {
    '[' => 'another empty key]'
  }
]

perl-xs-json

 na
YAML::XS::Load Error: The problem:

    did not find expected node content

was found at document: 1, line: 1, column: 5
while parsing a flow node at line: 1, column: 5

perl-yaml-json

 na
YAML Error: Can't parse inline sequence
   Code: YAML_PARSE_ERR_INLINE_SEQUENCE
   Line: 2
   Document: 1
 at /perl5/lib/perl5/YAML/Loader.pm line 551.

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/composer.py", line 27, in get_node
    return self.compose_document()
  File "/python/lib/python3.7/site-packages/yaml/composer.py", line 55, in compose_document
    node = self.compose_node(None, None)
  File "/python/lib/python3.7/site-packages/yaml/composer.py", line 82, in compose_node
    node = self.compose_sequence_node(anchor)
  File "/python/lib/python3.7/site-packages/yaml/composer.py", line 111, in compose_sequence_node
    node.value.append(self.compose_node(node, index))
  File "/python/lib/python3.7/site-packages/yaml/composer.py", line 82, in compose_node
    node = self.compose_sequence_node(anchor)
  File "/python/lib/python3.7/site-packages/yaml/composer.py", line 110, in compose_sequence_node
    while not self.check_event(SequenceEndEvent):
  File "/python/lib/python3.7/site-packages/yaml/parser.py", line 98, in check_event
    self.current_event = self.state()
  File "/python/lib/python3.7/site-packages/yaml/parser.py", line 474, in parse_flow_sequence_first_entry
    return self.parse_flow_sequence_entry(first=True)
  File "/python/lib/python3.7/site-packages/yaml/parser.py", line 495, in parse_flow_sequence_entry
    return self.parse_flow_node()
  File "/python/lib/python3.7/site-packages/yaml/parser.py", line 268, in parse_flow_node
    return self.parse_node()
  File "/python/lib/python3.7/site-packages/yaml/parser.py", line 371, in parse_node
    token.start_mark)
yaml.parser.ParserError: while parsing a flow node
expected the node content, but found ':'
  in "<unicode string>", line 1, column 5:
    - [ : empty key ]
        ^

py-ruamel-json

 na
Traceback (most recent call last):
  File "/yaml/bin/py-ruamel-json", line 19, in <module>
    for doc in ruamel.yaml.load_all(sys.stdin.read(), Loader=ruamel.yaml.Loader):
  File "/python/lib/python3.7/site-packages/ruamel/yaml/main.py", line 976, in load_all
    yield loader._constructor.get_data()
  File "/python/lib/python3.7/site-packages/ruamel/yaml/constructor.py", line 106, in get_data
    return self.construct_document(self.composer.get_node())
  File "/python/lib/python3.7/site-packages/ruamel/yaml/composer.py", line 68, in get_node
    return self.compose_document()
  File "/python/lib/python3.7/site-packages/ruamel/yaml/composer.py", line 101, in compose_document
    node = self.compose_node(None, None)
  File "/python/lib/python3.7/site-packages/ruamel/yaml/composer.py", line 136, in compose_node
    node = self.compose_sequence_node(anchor)
  File "/python/lib/python3.7/site-packages/ruamel/yaml/composer.py", line 180, in compose_sequence_node
    node.value.append(self.compose_node(node, index))
  File "/python/lib/python3.7/site-packages/ruamel/yaml/composer.py", line 136, in compose_node
    node = self.compose_sequence_node(anchor)
  File "/python/lib/python3.7/site-packages/ruamel/yaml/composer.py", line 179, in compose_sequence_node
    while not self.parser.check_event(SequenceEndEvent):
  File "/python/lib/python3.7/site-packages/ruamel/yaml/parser.py", line 140, in check_event
    self.current_event = self.state()
  File "/python/lib/python3.7/site-packages/ruamel/yaml/parser.py", line 642, in parse_flow_sequence_first_entry
    return self.parse_flow_sequence_entry(first=True)
  File "/python/lib/python3.7/site-packages/ruamel/yaml/parser.py", line 668, in parse_flow_sequence_entry
    return self.parse_flow_node()
  File "/python/lib/python3.7/site-packages/ruamel/yaml/parser.py", line 333, in parse_flow_node
    return self.parse_node()
  File "/python/lib/python3.7/site-packages/ruamel/yaml/parser.py", line 493, in parse_node
    token.start_mark,
ruamel.yaml.parser.ParserError: while parsing a flow node
expected the node content, but found ':'
  in "<unicode string>", line 1, column 5:
    - [ : empty key ]
        ^ (line: 1)

ruby-psych-json

 na
/usr/lib/ruby/2.5.0/psych.rb:405:in `parse': (<unknown>): did not find expected node content while parsing a flow node at line 1 column 5 (Psych::SyntaxError)
	from /usr/lib/ruby/2.5.0/psych.rb:405:in `parse_stream'
	from /usr/lib/ruby/2.5.0/psych.rb:488:in `load_stream'
	from /yaml/bin/ruby-psych-json:6:in `<main>'

c-libyaml-event

 ni
+STR
+DOC
+SEQ
+SEQ
Parse error: did not find expected node content

java-snakeyaml-event

 ni
Exception in thread "main" while parsing a flow node
 in 'reader', line 1, column 5:
    - [ : empty key ]
        ^
expected the node content, but found ':'
 in 'reader', line 1, column 5:
    - [ : empty key ]
        ^

	at org.yaml.snakeyaml.parser.ParserImpl.parseNode(ParserImpl.java:482)
	at org.yaml.snakeyaml.parser.ParserImpl.parseFlowNode(ParserImpl.java:364)
	at org.yaml.snakeyaml.parser.ParserImpl.access$2400(ParserImpl.java:117)
	at org.yaml.snakeyaml.parser.ParserImpl$ParseFlowSequenceEntry.produce(ParserImpl.java:648)
	at org.yaml.snakeyaml.parser.ParserImpl$ParseFlowSequenceFirstEntry.produce(ParserImpl.java:617)
	at org.yaml.snakeyaml.parser.ParserImpl.peekEvent(ParserImpl.java:158)
	at org.yaml.snakeyaml.Yaml$3.hasNext(Yaml.java:654)
	at org.yaml.editor.Snake2Events.yamlToEvents(Snake2Events.java:111)
	at org.yaml.editor.Snake2Events.main(Snake2Events.java:119)

perl-pplibyaml-event

 ni
YAML::PP::LibYAML Error: The problem:

    did not find expected node content

was found at , line: 1, column: 5
while parsing a flow node at line: 1, column: 5

perl-pplibyaml-perl

 ni
YAML::PP::LibYAML Error: The problem:

    did not find expected node content

was found at , line: 1, column: 5
while parsing a flow node at line: 1, column: 5

perl-xs-perl

 ni
YAML::XS::Load Error: The problem:

    did not find expected node content

was found at document: 1, line: 1, column: 5
while parsing a flow node at line: 1, column: 5

py-pyyaml-event

 ni
+STR
+DOC
+SEQ
+SEQ
Traceback (most recent call last):
  File "/yaml/bin/py-pyyaml-event", line 7, in <module>
    for event in yaml.parse(sys.stdin.read()):
  File "/python/lib/python3.7/site-packages/yaml/__init__.py", line 75, in parse
    while loader.check_event():
  File "/python/lib/python3.7/site-packages/yaml/parser.py", line 98, in check_event
    self.current_event = self.state()
  File "/python/lib/python3.7/site-packages/yaml/parser.py", line 474, in parse_flow_sequence_first_entry
    return self.parse_flow_sequence_entry(first=True)
  File "/python/lib/python3.7/site-packages/yaml/parser.py", line 495, in parse_flow_sequence_entry
    return self.parse_flow_node()
  File "/python/lib/python3.7/site-packages/yaml/parser.py", line 268, in parse_flow_node
    return self.parse_node()
  File "/python/lib/python3.7/site-packages/yaml/parser.py", line 371, in parse_node
    token.start_mark)
yaml.parser.ParserError: while parsing a flow node
expected the node content, but found ':'
  in "<unicode string>", line 1, column 5:
    - [ : empty key ]
        ^

py-pyyaml-py

 ni
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/composer.py", line 27, in get_node
    return self.compose_document()
  File "/python/lib/python3.7/site-packages/yaml/composer.py", line 55, in compose_document
    node = self.compose_node(None, None)
  File "/python/lib/python3.7/site-packages/yaml/composer.py", line 82, in compose_node
    node = self.compose_sequence_node(anchor)
  File "/python/lib/python3.7/site-packages/yaml/composer.py", line 111, in compose_sequence_node
    node.value.append(self.compose_node(node, index))
  File "/python/lib/python3.7/site-packages/yaml/composer.py", line 82, in compose_node
    node = self.compose_sequence_node(anchor)
  File "/python/lib/python3.7/site-packages/yaml/composer.py", line 110, in compose_sequence_node
    while not self.check_event(SequenceEndEvent):
  File "/python/lib/python3.7/site-packages/yaml/parser.py", line 98, in check_event
    self.current_event = self.state()
  File "/python/lib/python3.7/site-packages/yaml/parser.py", line 474, in parse_flow_sequence_first_entry
    return self.parse_flow_sequence_entry(first=True)
  File "/python/lib/python3.7/site-packages/yaml/parser.py", line 495, in parse_flow_sequence_entry
    return self.parse_flow_node()
  File "/python/lib/python3.7/site-packages/yaml/parser.py", line 268, in parse_flow_node
    return self.parse_node()
  File "/python/lib/python3.7/site-packages/yaml/parser.py", line 371, in parse_node
    token.start_mark)
yaml.parser.ParserError: while parsing a flow node
expected the node content, but found ':'
  in "<unicode string>", line 1, column 5:
    - [ : empty key ]
        ^