# YAML Test Matrix

--- &test-S98Z
  Title: Block scalar with more spaces than first content line
  Tags: [ comment, error, folded, scalar, whitespace ]

YAML

empty block scalar: >
 
  
   
 # comment

Expected Events

+STR
+DOC
+MAP
=VAL :empty block scalar

Expected JSON



c-libyaml-event

 invalid_incorrect
+STR
+DOC
+MAP
=VAL :empty block scalar
=VAL >
-MAP
-DOC
-STR

cpp-yamlcpp-event

 invalid_incorrect
+STR
+DOC
+MAP
=VAL :empty block scalar
=VAL :
-MAP
-DOC
-STR

dotnet-yamldotnet-event

 invalid_incorrect
+STR
+DOC
+MAP
=VAL :empty block scalar
=VAL >
-MAP
-DOC
-STR

dotnet-yamldotnet-json

 invalid_incorrect
{"empty block scalar": ""}

java-snakeyaml-event

 invalid_incorrect
+STR
+DOC
+MAP
=VAL :empty block scalar
=VAL >
-MAP
-DOC
-STR

java-snakeyaml-json

 invalid_incorrect
{
  "empty block scalar": ""
}

js-jsyaml-json

 invalid_incorrect
{"empty block scalar":""}

lua-lyaml-json

 invalid_incorrect
{"empty block scalar":""}

nim-nimyaml-event

 invalid_incorrect
+STR
+DOC
+MAP
=VAL :empty block scalar
=VAL >\n\n\n# comment\n
-MAP
-DOC
-STR

perl-pp-event

 invalid_incorrect
+STR
+DOC
+MAP
=VAL :empty block scalar
=VAL >
-MAP
-DOC
-STR

perl-pp-json

 invalid_incorrect
{
   "empty block scalar" : ""
}

perl-pp-perl

 invalid_incorrect
{
  'empty block scalar' => ''
}

perl-pplibyaml-event

 invalid_incorrect
+STR
+DOC
+MAP
=VAL :empty block scalar
=VAL >
-MAP
-DOC
-STR

perl-pplibyaml-json

 invalid_incorrect
{
   "empty block scalar" : ""
}

perl-pplibyaml-perl

 invalid_incorrect
{
  'empty block scalar' => ''
}

perl-syck-json

 invalid_incorrect
{
   "empty block scalar" : "\n\n\n# comment\n"
}

perl-syck-perl

 invalid_incorrect
{
  'empty block scalar' => '


# comment
'
}

perl-xs-json

 invalid_incorrect
{
   "empty block scalar" : ""
}

perl-xs-perl

 invalid_incorrect
{
  'empty block scalar' => ''
}

perl-yaml-json

 invalid_incorrect
{
   "empty block scalar" : "\n \n  \n# comment\n"
}

perl-yaml-perl

 invalid_incorrect
{
  'empty block scalar' => '
 
  
# comment
'
}

py-pyyaml-event

 invalid_incorrect
+STR
+DOC
+MAP
=VAL :empty block scalar
=VAL >
-MAP
-DOC
-STR

py-pyyaml-json

 invalid_incorrect
{
  "empty block scalar": ""
}

py-pyyaml-py

 invalid_incorrect
{'empty block scalar': ''}

py-ruamel-event

 invalid_incorrect
+STR
+DOC
+MAP
=VAL :empty block scalar
=VAL >
-MAP
-DOC
-STR

py-ruamel-json

 invalid_incorrect
{
  "empty block scalar": ""
}

py-ruamel-py

 invalid_incorrect
{'empty block scalar': ''}

ruby-psych-json

 invalid_incorrect
{"empty block scalar":""}

c-libfyaml-event

 invalid_correct
stdin:2:1: error: empty block scalar with wrongly indented comment line after spaces only
 
^
  
~~
   
~~~
 # comment
~
+STR
+DOC
+MAP
=VAL :empty block scalar

c-libfyaml-json

 invalid_correct
stdin:2:1: error: empty block scalar with wrongly indented comment line after spaces only
 
^
  
~~
   
~~~
 # comment
~

hs-hsyaml-event

 invalid_correct
Parsing error near byte offset Pos {posByteOffset = 42, posCharOffset = 42, posLine = 6, posColumn = 0} (leading empty lines contain more spaces than the first non-empty line in scalar: "\n \n  \n# comment\n")
+STR
+DOC
+MAP
=VAL :empty block scalar

hs-hsyaml-json

 invalid_correct
hsyaml-parser: user error (leading empty lines contain more spaces than the first non-empty line in scalar: "\n \n  \n# comment\n")

js-yaml-event

 invalid_correct
Block scalars with more-indented leading empty lines must use an explicit indentation indicator
+STR
+DOC
+MAP
=VAL :empty block scalar

js-yaml-json

 invalid_correct
/yaml/bin/js-yaml-json:8
  if (doc.errors.length !== 0) throw doc.errors[0]
                               ^

YAMLSemanticError: Block scalars with more-indented leading empty lines must use an explicit indentation indicator
    at BlockValue.parseBlockValue (/node/node_modules/yaml/dist/parse-cst.js:905:26)
    at BlockValue.parse (/node/node_modules/yaml/dist/parse-cst.js:967:19)
    at ParseContext.PlainValue._defineProperty (/node/node_modules/yaml/dist/parse-cst.js:1586:25)
    at CollectionItem.parse (/node/node_modules/yaml/dist/parse-cst.js:92:19)
    at ParseContext.PlainValue._defineProperty (/node/node_modules/yaml/dist/parse-cst.js:1586:25)
    at Collection.parse (/node/node_modules/yaml/dist/parse-cst.js:350:20)
    at ParseContext.PlainValue._defineProperty (/node/node_modules/yaml/dist/parse-cst.js:1605:29)
    at Document.parseContents (/node/node_modules/yaml/dist/parse-cst.js:622:26)
    at Document.parse (/node/node_modules/yaml/dist/parse-cst.js:685:19)
    at Object.parse (/node/node_modules/yaml/dist/parse-cst.js:1723:18)

perl-tiny-json

 invalid_correct
YAML::Tiny failed to find multi-line scalar content at /yaml/bin/perl-tiny-json line 12.

perl-tiny-perl

 invalid_correct
YAML::Tiny failed to find multi-line scalar content at /yaml/bin/perl-tiny-perl line 15.