# YAML Test Matrix

--- &test-FP8R
  Title: Zero indented block scalar
  Tags: [ folded, indent, scalar ]

YAML

--- >
line1
line2
line3

Expected Events

+STR
+DOC ---
=VAL >line1 line2 line3\n
-DOC
-STR

Expected JSON

"line1 line2 line3\n"

hs-yaml-event

 ok

js-event

 ok

nimyaml-event

 ok

perl5-pegex-event

 ok

perl5-pp-event

 ok

ruamel-event

 ok

hs-yaml-json

 json_ok

js-json

 json_ok

perl5-pm-json

 json_ok

perl5-pp-json

 json_ok

perl5-syck-json

 json_ok

perl5-tiny-json

 json_ok

ruamel-json

 json_ok

cpp-event

 diff
Minimal Events:
+STR
+DOC
=VAL :line1 line2 line3\n
-DOC
-STR
Transformed Events:
+STR
+DOC
=VAL :
-DOC
+DOC
=VAL :line1 line2 line3
-DOC
-STR
Got Events:
+STR
+DOC
=VAL :
-DOC
+DOC
=VAL :line1 line2 line3
-DOC
-STR

js-yaml-json

 json_diff
"line1 line2 line3 "

java-event

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

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

java-json

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

	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)

libyaml-event

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

luajit-json

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

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

perl5-xs-json

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

    did not find expected <document start>

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

perl5-xs-pl

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

    did not find expected <document start>

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

pyyaml-event

 error
+STR
+DOC ---
=VAL >
-DOC
Traceback (most recent call last):
  File "/bin/pyyaml-event", line 10, 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 '<scalar>'
  in "<string>", line 2, column 1:
    line1
    ^

pyyaml-json

 error
""
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 '<scalar>'
  in "<string>", line 2, column 1:
    line1
    ^

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 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 '<scalar>'
  in "<string>", line 2, column 1:
    line1
    ^

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>'

perl5-pm-pl

 na
'line1 line2 line3
'

perl5-pp-pl

 na
'line1 line2 line3
'

perl5-syck-pl

 na
'line1 line2 line3
'

perl5-tiny-pl

 na
'line1 line2 line3
'

ruamel-py

 na
'line1 line2 line3\n'