YAML Test Matrix

Test #7Z25 - Bare document after document end marker

YAML

---
scalar1
...
key: value

Expected Events

+STR
+DOC ---
=VAL :scalar1
-DOC ...
+DOC
+MAP
=VAL :key
=VAL :value
-MAP
-DOC
-STR

Expected JSON

"scalar1"
{
"key": "value"
}

cpp-event

 ok

hs-yaml-event

 ok

java-event

 error
Exception in thread "main" expected '<document start>', but found '<block mapping start>'
 in 'reader', line 4, column 1:
    key: value
    ^

	at org.yaml.snakeyaml.parser.ParserImpl$ParseDocumentStart.produce(ParserImpl.java:226)
	at org.yaml.snakeyaml.parser.ParserImpl.peekEvent(ParserImpl.java:158)
	at org.yaml.snakeyaml.Yaml$3.hasNext(Yaml.java:711)
	at org.yaml.editor.Snake2Events.yamlToEvents(Snake2Events.java:110)
	at org.yaml.editor.Snake2Events.main(Snake2Events.java:118)

java-json

 error
"scalar1"
Exception in thread "main" expected '<document start>', but found '<block mapping start>'
 in 'reader', line 4, column 1:
    key: value
    ^

	at org.yaml.snakeyaml.parser.ParserImpl$ParseDocumentStart.produce(ParserImpl.java:226)
	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.checkNode(Composer.java:68)
	at org.yaml.snakeyaml.constructor.BaseConstructor.checkData(BaseConstructor.java:112)
	at org.yaml.snakeyaml.Yaml$1.hasNext(Yaml.java:542)
	at org.yaml.editor.Snake2Json.yamlToJson(Snake2Json.java:18)
	at org.yaml.editor.Snake2Json.main(Snake2Json.java:25)

js-yaml-json

 json_ok

libyaml-event

 error
+STR
+DOC ---
=VAL :scalar1
-DOC ...
Parse error: did not find expected <document start>

luajit-json

 error
luajit: did not find expected <document start> at document: 1, line: 4, column: 1

stack traceback:
	[C]: in function 'load'
	/bin/luajit-json:6: in main chunk
	[C]: at 0x004044a0

nimyaml-event

 ok

perl5-pegex-event

 error
Maximum parsing rules reached (1000)

perl5-pm-json

 error
YAML Error: Expected separator '---'
   Code: YAML_PARSE_ERR_NO_SEPARATOR
   Line: 2
   Document: 2
 at /lib/perl5/YAML/Loader.pm line 79.

perl5-pm-pl

 error
YAML Error: Expected separator '---'
   Code: YAML_PARSE_ERR_NO_SEPARATOR
   Line: 2
   Document: 2
 at /lib/perl5/YAML/Loader.pm line 79.

perl5-pp-event

 ok

perl5-pp-json

 json_ok

perl5-pp-pl

 n/a
'scalar1'
{
  'key' => 'value'
}

perl5-syck-json

 json_diff
{
  "scalar1 ... key": "value"
}

perl5-syck-pl

 n/a
{
  'scalar1 ... key' => 'value'
}

perl5-tiny-json

 error
YAML::Tiny failed to classify line 'scalar1' at /bin/perl5-tiny-json line 15.

perl5-tiny-pl

 error
YAML::Tiny failed to classify line 'scalar1' at /bin/perl5-tiny-pl line 14.

perl5-xs-json

 error
YAML::XS::Load Error: The problem:

    did not find expected <document start>

was found at document: 2, line: 4, column: 1

perl5-xs-pl

 error
YAML::XS::Load Error: The problem:

    did not find expected <document start>

was found at document: 2, line: 4, column: 1

pyyaml-event

 error
+STR
+DOC ---
=VAL :scalar1
-DOC ...
Traceback (most recent call last):
  File "/bin/pyyaml-event", line 7, in <module>
    for event in yaml.parse(sys.stdin.read()):
  File "/lib/python2.7/site-packages/yaml/__init__.py", line 36, in parse
    while loader.check_event():
  File "/lib/python2.7/site-packages/yaml/parser.py", line 98, in check_event
    self.current_event = self.state()
  File "/lib/python2.7/site-packages/yaml/parser.py", line 174, in parse_document_start
    self.peek_token().start_mark)
yaml.parser.ParserError: expected '<document start>', but found '<block mapping start>'
  in "<string>", line 4, column 1:
    key: value
    ^

pyyaml-json

 error
"scalar1"
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 89, in load_all
    while loader.check_data():
  File "/lib/python2.7/site-packages/yaml/constructor.py", line 28, in check_data
    return self.check_node()
  File "/lib/python2.7/site-packages/yaml/composer.py", line 18, in check_node
    if self.check_event(StreamStartEvent):
  File "/lib/python2.7/site-packages/yaml/parser.py", line 98, in check_event
    self.current_event = self.state()
  File "/lib/python2.7/site-packages/yaml/parser.py", line 174, in parse_document_start
    self.peek_token().start_mark)
yaml.parser.ParserError: expected '<document start>', but found '<block mapping start>'
  in "<string>", line 4, column 1:
    key: value
    ^

pyyaml-py

 error
'scalar1'
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 89, in load_all
    while loader.check_data():
  File "/lib/python2.7/site-packages/yaml/constructor.py", line 28, in check_data
    return self.check_node()
  File "/lib/python2.7/site-packages/yaml/composer.py", line 18, in check_node
    if self.check_event(StreamStartEvent):
  File "/lib/python2.7/site-packages/yaml/parser.py", line 98, in check_event
    self.current_event = self.state()
  File "/lib/python2.7/site-packages/yaml/parser.py", line 174, in parse_document_start
    self.peek_token().start_mark)
yaml.parser.ParserError: expected '<document start>', but found '<block mapping start>'
  in "<string>", line 4, column 1:
    key: value
    ^

ruamel-event

 ok

ruamel-json

 json_ok

ruamel-py

 n/a
'scalar1'
{'key': 'value'}

ruby-json

 error
/usr/lib/ruby/2.3.0/psych.rb:380:in `parse': (<unknown>): did not find expected <document start> at line 1 column 1 (Psych::SyntaxError)
	from /usr/lib/ruby/2.3.0/psych.rb:380:in `parse_stream'
	from /usr/lib/ruby/2.3.0/psych.rb:463:in `load_stream'
	from /bin/ruby-json:6:in `<main>'