# YAML Test Matrix

--- &test-SU5Z
  Title: Comment without whitespace after doublequoted scalar
  Tags: [ comment, double, error, whitespace ]

YAML

key: "value"# invalid comment

Expected Events

+STR
+DOC
+MAP
=VAL :key
=VAL "value

Expected JSON



c-libyaml-event

 invalid_incorrect
+STR
+DOC
+MAP
=VAL :key
=VAL "value
-MAP
-DOC
-STR

cpp-yamlcpp-event

 invalid_incorrect
+STR
+DOC
+MAP
=VAL :key
=VAL :value
-MAP
-DOC
-STR

dotnet-yamldotnet-event

 invalid_incorrect
+STR
+DOC
+MAP
=VAL :key
=VAL "value
-MAP
-DOC
-STR

dotnet-yamldotnet-json

 invalid_incorrect
{"key": "value"}

java-snakeyaml-event

 invalid_incorrect
+STR
+DOC
+MAP
=VAL :key
=VAL "value
-MAP
-DOC
-STR

java-snakeyaml-json

 invalid_incorrect
{
  "key": "value"
}

js-jsyaml-json

 invalid_incorrect
{"key":"value"}

lua-lyaml-json

 invalid_incorrect
{"key":"value"}

nim-nimyaml-event

 invalid_incorrect
+STR
+DOC
+MAP
=VAL :key
=VAL "value
-MAP
-DOC
-STR

perl-pplibyaml-event

 invalid_incorrect
+STR
+DOC
+MAP
=VAL :key
=VAL "value
-MAP
-DOC
-STR

perl-pplibyaml-json

 invalid_incorrect
{
   "key" : "value"
}

perl-pplibyaml-perl

 invalid_incorrect
{
  'key' => 'value'
}

perl-syck-json

 invalid_incorrect
{
   "key" : "value"
}

perl-syck-perl

 invalid_incorrect
{
  'key' => 'value'
}

perl-xs-json

 invalid_incorrect
{
   "key" : "value"
}

perl-xs-perl

 invalid_incorrect
{
  'key' => 'value'
}

py-pyyaml-event

 invalid_incorrect
+STR
+DOC
+MAP
=VAL :key
=VAL "value
-MAP
-DOC
-STR

py-pyyaml-json

 invalid_incorrect
{
  "key": "value"
}

py-pyyaml-py

 invalid_incorrect
{'key': 'value'}

py-ruamel-event

 invalid_incorrect
+STR
+DOC
+MAP
=VAL :key
=VAL "value
-MAP
-DOC
-STR

py-ruamel-json

 invalid_incorrect
{
  "key": "value"
}

py-ruamel-py

 invalid_incorrect
{'key': 'value'}

ruby-psych-json

 invalid_incorrect
{"key":"value"}

c-libfyaml-event

 invalid_correct
stdin:1:13: error: invalid comment without whitespace after double-quoted scalar
key: "value"# invalid comment
            ^
+STR
+DOC
+MAP
=VAL :key

c-libfyaml-json

 invalid_correct
stdin:1:13: error: invalid comment without whitespace after double-quoted scalar
key: "value"# invalid comment
            ^

hs-hsyaml-event

 invalid_correct
Parsing error near byte offset Pos {posByteOffset = 12, posCharOffset = 12, posLine = 1, posColumn = 12} (Expected start of line)
+STR
+DOC
+MAP
=VAL :key
=VAL "value

hs-hsyaml-json

 invalid_correct
hsyaml-parser: user error (Expected start of line)

js-yaml-event

 invalid_correct
Comments must be separated from other tokens by white space characters
+STR
+DOC
+MAP
=VAL :key

js-yaml-json

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

YAMLSemanticError: Comments must be separated from other tokens by white space characters
    at resolveNodeProps (/node/node_modules/yaml/dist/resolveSeq-4a68b39b.js:1469:25)
    at resolveNode (/node/node_modules/yaml/dist/resolveSeq-4a68b39b.js:1561:7)
    at resolveBlockMapItems (/node/node_modules/yaml/dist/resolveSeq-4a68b39b.js:1777:38)
    at Object.resolveMap [as resolve] (/node/node_modules/yaml/dist/resolveSeq-4a68b39b.js:1612:79)
    at resolveByTagName (/node/node_modules/yaml/dist/resolveSeq-4a68b39b.js:1384:25)
    at resolveTag (/node/node_modules/yaml/dist/resolveSeq-4a68b39b.js:1414:17)
    at resolveNodeValue (/node/node_modules/yaml/dist/resolveSeq-4a68b39b.js:1535:23)
    at Object.resolveNode (/node/node_modules/yaml/dist/resolveSeq-4a68b39b.js:1583:15)
    at parseContents (/node/node_modules/yaml/dist/Document-2cf6b08c.js:357:30)
    at Document.parse (/node/node_modules/yaml/dist/Document-2cf6b08c.js:615:5)

perl-pp-event

 invalid_correct
Line      : 1
Column    : 13
Message   : Invalid plain scalar
Where     : /perl5/lib/perl5/YAML/PP/Lexer.pm line 361
YAML      : "# invalid comment"
  at /yaml/bin/perl-pp-event line 25.
+STR
+DOC
+MAP
=VAL :key

perl-pp-json

 invalid_correct
Line      : 1
Column    : 13
Message   : Invalid plain scalar
Where     : /perl5/lib/perl5/YAML/PP/Lexer.pm line 361
YAML      : "# invalid comment"
  at /perl5/lib/perl5/YAML/PP/Loader.pm line 92.

perl-pp-perl

 invalid_correct
Line      : 1
Column    : 13
Message   : Invalid plain scalar
Where     : /perl5/lib/perl5/YAML/PP/Lexer.pm line 361
YAML      : "# invalid comment"
  at /perl5/lib/perl5/YAML/PP/Loader.pm line 92.

perl-tiny-json

 invalid_correct
YAML::Tiny does not support a feature in line '"value"# invalid comment' at /yaml/bin/perl-tiny-json line 12.

perl-tiny-perl

 invalid_correct
YAML::Tiny does not support a feature in line '"value"# invalid comment' at /yaml/bin/perl-tiny-perl line 15.

perl-yaml-json

 invalid_correct
YAML Error: Couldn't parse single line value
   Code: YAML_PARSE_ERR_SINGLE_LINE
   Line: 1
   Document: 1
 at /perl5/lib/perl5/YAML/Loader.pm line 164.

perl-yaml-perl

 invalid_correct
YAML Error: Couldn't parse single line value
   Code: YAML_PARSE_ERR_SINGLE_LINE
   Line: 1
   Document: 1
 at /perl5/lib/perl5/YAML/Loader.pm line 164.