# YAML Test Matrix

--- &test-M7A3
  Title: Spec Example 9.3. Bare Documents
  Tags: [ 1.3-err, footer, spec ]

YAML

Bare
document
...
# No document
...
|
%!PS-Adobe-2.0 # Not the first line

Expected Events

+STR
+DOC
=VAL :Bare document
-DOC ...
+DOC
=VAL |%!PS-Adobe-2.0 # Not the first line\n
-DOC
-STR

Expected JSON

"Bare document"
"%!PS-Adobe-2.0 # Not the first line\n"

c-libfyaml-event

 ok

dotnet-yamldotnet-event

 ok

hs-hsyaml-event

 ok

js-yaml-event

 ok

nim-nimyaml-event

 ok

perl-pp-event

 ok

perl-refparser-event

 ok

c-libfyaml-json

 json_ok

hs-hsyaml-json

 json_ok

perl-pp-json

 json_ok

cpp-rapidyaml-event

 diff
Minimal Events:
+STR
+DOC
=VAL :Bare document
-DOC ...
+DOC
=VAL :%!PS-Adobe-2.0 # Not the first line\n
-DOC
-STR
Transformed Events:
+STR
+DOC ---
=VAL :Bare document
-DOC
+DOC ---
=VAL :%!PS-Adobe-2.0 # Not the first line\n
-DOC
-STR
Got Events:
+STR
+DOC ---
=VAL :Bare document
-DOC
+DOC ---
=VAL '%!PS-Adobe-2.0 # Not the first line\n
-DOC
-STR

cpp-yamlcpp-event

 diff
Minimal Events:
+STR
+DOC
=VAL :Bare document
-DOC
+DOC
=VAL :%!PS-Adobe-2.0 # Not the first line\n
-DOC
-STR
Transformed Events:
+STR
+DOC
=VAL :Bare document
-DOC
+DOC
=VAL :
-DOC
-STR
Got Events:
+STR
+DOC
=VAL :Bare document
-DOC
+DOC
=VAL :
-DOC
-STR

js-jsyaml-json

 json_diff
"Bare document"
null
"%!PS-Adobe-2.0 # Not the first line\n"

js-yaml-json

 json_diff
"Bare document"
null
"%!PS-Adobe-2.0 # Not the first line\n"

perl-syck-json

 json_diff
"Bare document ... # No document ... | %!PS-Adobe-2.0"

c-libyaml-event

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

dotnet-yamldotnet-json

 error
Unhandled exception. YamlDotNet.Core.YamlException: (Line: 6, Col: 1, Idx: 36) - (Line: 8, Col: 1, Idx: 74): Expected 'StreamEnd', got 'DocumentStart' (at Line: 6, Col: 1, Idx: 36).
   at YamlDotNet.Core.ParserExtensions.Require[T](IParser parser)
   at YamlDotNet.Core.ParserExtensions.Consume[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)

go-yaml-json

 error
"Bare document"
yaml: line 5: did not find expected <document start>

java-snakeengine-event

 error
Exception in thread "main" expected '<document start>', but found '<scalar>'
 in reader, line 6, column 1:
    |
    ^

	at org.snakeyaml.engine.v2.parser.ParserImpl$ParseDocumentStart.produce(ParserImpl.java:292)
	at org.snakeyaml.engine.v2.parser.ParserImpl.lambda$produce$0(ParserImpl.java:185)
	at java.util.Optional.ifPresent(Optional.java:159)
	at org.snakeyaml.engine.v2.parser.ParserImpl.produce(ParserImpl.java:185)
	at org.snakeyaml.engine.v2.parser.ParserImpl.hasNext(ParserImpl.java:210)
	at org.yaml.editor.SnakeEngine2Events.yamlToEvents(SnakeEngine2Events.java:15)
	at org.yaml.editor.SnakeEngine2Events.main(SnakeEngine2Events.java:23)

java-snakeengine-json

 error
"Bare document"
Exception in thread "main" expected '<document start>', but found '<scalar>'
 in 'reader', line 6, column 1:
    |
    ^

	at org.yaml.snakeyaml.parser.ParserImpl$ParseDocumentStart.produce(ParserImpl.java:259)
	at org.yaml.snakeyaml.parser.ParserImpl.peekEvent(ParserImpl.java:166)
	at org.yaml.snakeyaml.parser.ParserImpl.checkEvent(ParserImpl.java:156)
	at org.yaml.snakeyaml.composer.Composer.checkNode(Composer.java:90)
	at org.yaml.snakeyaml.constructor.BaseConstructor.checkData(BaseConstructor.java:124)
	at org.yaml.snakeyaml.Yaml$1.hasNext(Yaml.java:509)
	at org.yaml.editor.Snake2Json.yamlToJson(Snake2Json.java:20)
	at org.yaml.editor.Snake2Json.main(Snake2Json.java:27)

java-snakeyaml-event

 error
Exception in thread "main" expected '<document start>', but found '<scalar>'
 in 'reader', line 6, column 1:
    |
    ^

	at org.yaml.snakeyaml.parser.ParserImpl$ParseDocumentStart.produce(ParserImpl.java:259)
	at org.yaml.snakeyaml.parser.ParserImpl.peekEvent(ParserImpl.java:166)
	at org.yaml.snakeyaml.Yaml$3.hasNext(Yaml.java:677)
	at org.yaml.editor.Snake2Events.yamlToEvents(Snake2Events.java:134)
	at org.yaml.editor.Snake2Events.main(Snake2Events.java:142)

java-snakeyaml-json

 error
"Bare document"
Exception in thread "main" expected '<document start>', but found '<scalar>'
 in 'reader', line 6, column 1:
    |
    ^

	at org.yaml.snakeyaml.parser.ParserImpl$ParseDocumentStart.produce(ParserImpl.java:259)
	at org.yaml.snakeyaml.parser.ParserImpl.peekEvent(ParserImpl.java:166)
	at org.yaml.snakeyaml.parser.ParserImpl.checkEvent(ParserImpl.java:156)
	at org.yaml.snakeyaml.composer.Composer.checkNode(Composer.java:90)
	at org.yaml.snakeyaml.constructor.BaseConstructor.checkData(BaseConstructor.java:124)
	at org.yaml.snakeyaml.Yaml$1.hasNext(Yaml.java:509)
	at org.yaml.editor.Snake2Json.yamlToJson(Snake2Json.java:20)
	at org.yaml.editor.Snake2Json.main(Snake2Json.java:27)

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:306: in function 'error'
	/usr/local/share/lua/5.1/lyaml/init.lua:325: in function 'parse'
	/usr/local/share/lua/5.1/lyaml/init.lua:496: in function 'load'
	/yaml/bin/lua-lyaml-json:6: in main chunk
	[C]: at 0x55d06142af97

perl-pplibyaml-json

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

    did not find expected <document start>

was found at , line: 6, column: 1

perl-pplibyaml-perl

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

    did not find expected <document start>

was found at , line: 6, column: 1

perl-tiny-json

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

perl-tiny-perl

 error
YAML::Tiny failed to classify line 'Bare' 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: 6, column: 1

perl-xs-perl

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

    did not find expected <document start>

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

perl-yaml-json

 error
YAML Error: Expected separator '---'
   Code: YAML_PARSE_ERR_NO_SEPARATOR
   Line: 1
   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: 1
   Document: 2
 at /perl5/lib/perl5/YAML/Loader.pm line 88.

py-pyyaml-event

 error
+STR
+DOC
=VAL :Bare document
-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 46, 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 '<scalar>'
  in "<unicode string>", line 6, column 1:
    |
    ^

py-pyyaml-json

 error
"Bare document"
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 92, 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 '<scalar>'
  in "<unicode string>", line 6, column 1:
    |
    ^

py-pyyaml-py

 error
'Bare document'
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 92, 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 '<scalar>'
  in "<unicode string>", line 6, column 1:
    |
    ^

py-ruamel-event

 error
+STR
+DOC
=VAL :Bare document
-DOC ...
+DOC
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 1024, in parse
    while loader._parser.check_event():
  File "/python/lib/python3.7/site-packages/ruamel/yaml/parser.py", line 146, in check_event
    self.current_event = self.state()
  File "/python/lib/python3.7/site-packages/ruamel/yaml/parser.py", line 344, in parse_block_node
    return self.parse_node(block=True)
  File "/python/lib/python3.7/site-packages/ruamel/yaml/parser.py", line 513, in parse_node
    token.start_mark,
ruamel.yaml.parser.ParserError: while parsing a block node
expected the node content, but found '<document end>'
  in "<unicode string>", line 5, column 1:
    ...
    ^ (line: 5)

py-ruamel-json

 error
"Bare document"
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 1097, in load_all
    yield loader._constructor.get_data()
  File "/python/lib/python3.7/site-packages/ruamel/yaml/constructor.py", line 114, in get_data
    return self.construct_document(self.composer.get_node())
  File "/python/lib/python3.7/site-packages/ruamel/yaml/composer.py", line 66, in get_node
    return self.compose_document()
  File "/python/lib/python3.7/site-packages/ruamel/yaml/composer.py", line 99, in compose_document
    node = self.compose_node(None, None)
  File "/python/lib/python3.7/site-packages/ruamel/yaml/composer.py", line 113, in compose_node
    if self.parser.check_event(AliasEvent):
  File "/python/lib/python3.7/site-packages/ruamel/yaml/parser.py", line 146, in check_event
    self.current_event = self.state()
  File "/python/lib/python3.7/site-packages/ruamel/yaml/parser.py", line 344, in parse_block_node
    return self.parse_node(block=True)
  File "/python/lib/python3.7/site-packages/ruamel/yaml/parser.py", line 513, in parse_node
    token.start_mark,
ruamel.yaml.parser.ParserError: while parsing a block node
expected the node content, but found '<document end>'
  in "<unicode string>", line 5, column 1:
    ...
    ^ (line: 5)

py-ruamel-py

 error
'Bare document'
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 1097, in load_all
    yield loader._constructor.get_data()
  File "/python/lib/python3.7/site-packages/ruamel/yaml/constructor.py", line 114, in get_data
    return self.construct_document(self.composer.get_node())
  File "/python/lib/python3.7/site-packages/ruamel/yaml/composer.py", line 66, in get_node
    return self.compose_document()
  File "/python/lib/python3.7/site-packages/ruamel/yaml/composer.py", line 99, in compose_document
    node = self.compose_node(None, None)
  File "/python/lib/python3.7/site-packages/ruamel/yaml/composer.py", line 113, in compose_node
    if self.parser.check_event(AliasEvent):
  File "/python/lib/python3.7/site-packages/ruamel/yaml/parser.py", line 146, in check_event
    self.current_event = self.state()
  File "/python/lib/python3.7/site-packages/ruamel/yaml/parser.py", line 344, in parse_block_node
    return self.parse_node(block=True)
  File "/python/lib/python3.7/site-packages/ruamel/yaml/parser.py", line 513, in parse_node
    token.start_mark,
ruamel.yaml.parser.ParserError: while parsing a block node
expected the node content, but found '<document end>'
  in "<unicode string>", line 5, column 1:
    ...
    ^ (line: 5)

raku-yamlish-json

 error
Couldn't parse YAML
  in sub load-yamls at /raku/sources/44795C7AB0F35700F4CA9C3E2CC5C924EE4C608F (YAMLish) line 959
  in block <unit> at /yaml/bin/raku-yamlish-json line 6

raku-yamlish-raku

 error
Couldn't parse YAML
  in sub load-yamls at /raku/sources/44795C7AB0F35700F4CA9C3E2CC5C924EE4C608F (YAMLish) line 959
  in block <unit> at /yaml/bin/raku-yamlish-raku line 6

ruby-psych-json

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

rust-yamlrust-event

 error
+STR
+DOC
=VAL :Bare document
-DOC
Error: ScanError { mark: Marker { index: 38, line: 7, col: 0 }, info: "did not find expected <document start>" }

hs-reference-yeast

 na
Line  Col Char Byte Token|Content
   1    0    0    0 +DOC |
   1    0    0    0 +NODE|
   1    0    0    0 +VAL |
   1    0    0    0 =TEXT|Bare
   1    4    4    4 =FOLD|\x0a
   2    0    5    5 =TEXT|document
   2    8   13   13 -VAL |
   2    8   13   13 -NODE|
   2    8   13   13 =EOL |\x0a
   3    0   14   14 -DOC |
   3    0   14   14 =FOOT|...
   3    3   17   17 =EOL |\x0a
   4    0   18   18 +COMM|
   4    0   18   18 =SYNX|#
   4    1   19   19 =META|.No.document
   4   13   31   31 -COMM|
   4   13   31   31 =EOL |\x0a
   5    0   32   32 =FOOT|...
   5    3   35   35 =EOL |\x0a
   6    0   36   36 +DOC |
   6    0   36   36 +NODE|
   6    0   36   36 +VAL |
   6    0   36   36 =SYNX||
   6    1   37   37 =EOL |\x0a
   7    0   38   38 =TEXT|%!PS-Adobe-2.0.#.Not.the.first.line
   7   35   73   73 =NEWL|\x0a
   8    0   74   74 -VAL |
   8    0   74   74 -NODE|
   8    0   74   74 -DOC |

perl-pp-perl

 na
'Bare document'
'%!PS-Adobe-2.0 # Not the first line
'

perl-syck-perl

 na
'Bare document ... # No document ... | %!PS-Adobe-2.0'