# YAML Test Matrix

--- &test-7Z25
  Title: Bare document after document end marker
  Tags: [ footer ]

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"
}

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

 ok

py-ruamel-event

 ok

c-libfyaml-json

 json_ok

hs-hsyaml-json

 json_ok

js-jsyaml-json

 json_ok

js-yaml-json

 json_ok

perl-pp-json

 json_ok

py-ruamel-json

 json_ok

perl-syck-json

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

c-libyaml-event

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

dotnet-yamldotnet-json

 error
Unhandled exception. YamlDotNet.Core.YamlException: (Line: 4, Col: 1, Idx: 16) - (Line: 4, Col: 1, Idx: 16): Expected 'StreamEnd', got 'DocumentStart' (at Line: 4, Col: 1, Idx: 16).
   at YamlDotNet.Core.ParserExtensions.Expect[T](IParser parser)
   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)

java-snakeyaml-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:654)
	at org.yaml.editor.Snake2Events.yamlToEvents(Snake2Events.java:111)
	at org.yaml.editor.Snake2Events.main(Snake2Events.java:119)

java-snakeyaml-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:78)
	at org.yaml.snakeyaml.constructor.BaseConstructor.checkData(BaseConstructor.java:123)
	at org.yaml.snakeyaml.Yaml$1.hasNext(Yaml.java:489)
	at org.yaml.editor.Snake2Json.yamlToJson(Snake2Json.java:18)
	at org.yaml.editor.Snake2Json.main(Snake2Json.java:25)

lua-lyaml-json

 error
luajit: 3:1: did not find expected <document start>
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:481: in function 'load'
	/yaml/bin/lua-lyaml-json:6: in main chunk
	[C]: at 0x55bac1729f97

perl-pplibyaml-event

 error
YAML::PP::LibYAML Error: The problem:

    did not find expected <document start>

was found at , line: 4, column: 1

perl-pplibyaml-json

 error
YAML::PP::LibYAML Error: The problem:

    did not find expected <document start>

was found at , line: 4, column: 1

perl-pplibyaml-perl

 error
YAML::PP::LibYAML Error: The problem:

    did not find expected <document start>

was found at , line: 4, column: 1

perl-tiny-json

 error
YAML::Tiny failed to classify line 'scalar1' at /yaml/bin/perl-tiny-json line 12.

perl-tiny-perl

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

perl-xs-json

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

    did not find expected <document start>

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

perl-xs-perl

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

    did not find expected <document start>

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

perl-yaml-json

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

perl-yaml-perl

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

py-pyyaml-event

 error
+STR
+DOC ---
=VAL :scalar1
-DOC ...
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 174, in parse_document_start
    self.peek_token().start_mark)
yaml.parser.ParserError: expected '<document start>', but found '<block mapping start>'
  in "<unicode string>", line 4, column 1:
    key: value
    ^

py-pyyaml-json

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

py-pyyaml-py

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

ruby-psych-json

 error
/usr/lib/ruby/2.5.0/psych.rb:405:in `parse': (<unknown>): did not find expected <document start> at line 1 column 1 (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>'

perl-pp-perl

 na
'scalar1'
{
  'key' => 'value'
}

perl-syck-perl

 na
{
  'scalar1 ... key' => 'value'
}

py-ruamel-py

 na
'scalar1'
{'key': 'value'}