# YAML Test Matrix

--- &test-CVW2
  Title: Invalid comment after comma
  Tags: [ comment, error, flow, sequence ]

YAML

---
[ a, b, c,#invalid
]

Expected Events

+STR
+DOC ---
+SEQ
=VAL :a
=VAL :b
=VAL :c

Expected JSON



c-libyaml-event

 invalid_incorrect
+STR
+DOC ---
+SEQ
=VAL :a
=VAL :b
=VAL :c
-SEQ
-DOC
-STR

cpp-yamlcpp-event

 invalid_incorrect
+STR
+DOC
+SEQ
=VAL :a
=VAL :b
=VAL :c
-SEQ
-DOC
-STR

dotnet-yamldotnet-event

 invalid_incorrect
+STR
+DOC ---
+SEQ
=VAL :a
=VAL :b
=VAL :c
-SEQ
-DOC
-STR

dotnet-yamldotnet-json

 invalid_incorrect
["a", "b", "c"]

java-snakeyaml-event

 invalid_incorrect
+STR
+DOC ---
+SEQ
=VAL :a
=VAL :b
=VAL :c
-SEQ
-DOC
-STR

java-snakeyaml-json

 invalid_incorrect
[
  "a",
  "b",
  "c"
]

js-jsyaml-json

 invalid_incorrect
["a","b","c"]

lua-lyaml-json

 invalid_incorrect
["a","b","c"]

nim-nimyaml-event

 invalid_incorrect
+STR
+DOC ---
+SEQ
=VAL :a
=VAL :b
=VAL :c
-SEQ
-DOC
-STR

perl-pplibyaml-event

 invalid_incorrect
+STR
+DOC ---
+SEQ
=VAL :a
=VAL :b
=VAL :c
-SEQ
-DOC
-STR

perl-pplibyaml-json

 invalid_incorrect
[
   "a",
   "b",
   "c"
]

perl-pplibyaml-perl

 invalid_incorrect
[
  'a',
  'b',
  'c'
]

perl-syck-json

 invalid_incorrect
[
   "a",
   "b",
   "c,#invalid"
]

perl-syck-perl

 invalid_incorrect
[
  'a',
  'b',
  'c,#invalid'
]

perl-xs-json

 invalid_incorrect
[
   "a",
   "b",
   "c"
]

perl-xs-perl

 invalid_incorrect
[
  'a',
  'b',
  'c'
]

py-pyyaml-event

 invalid_incorrect
+STR
+DOC ---
+SEQ
=VAL :a
=VAL :b
=VAL :c
-SEQ
-DOC
-STR

py-pyyaml-json

 invalid_incorrect
[
  "a",
  "b",
  "c"
]

py-pyyaml-py

 invalid_incorrect
['a', 'b', 'c']

py-ruamel-event

 invalid_incorrect
+STR
+DOC ---
+SEQ
=VAL :a
=VAL :b
=VAL :c
-SEQ
-DOC
-STR

py-ruamel-json

 invalid_incorrect
[
  "a",
  "b",
  "c"
]

py-ruamel-py

 invalid_incorrect
['a', 'b', 'c']

ruby-psych-json

 invalid_incorrect
["a","b","c"]

c-libfyaml-event

 invalid_correct
stdin:2:11: error: invalid comment after comma
[ a, b, c,#invalid
          ^
+STR
+DOC ---

c-libfyaml-json

 invalid_correct
stdin:2:11: error: invalid comment after comma
[ a, b, c,#invalid
          ^

hs-hsyaml-event

 invalid_correct
Parsing error near byte offset Pos {posByteOffset = 4, posCharOffset = 4, posLine = 2, posColumn = 0} (Lexical error near "[ a, b, c,#invalid")
+STR
+DOC ---
=VAL :

hs-hsyaml-json

 invalid_correct
hsyaml-parser: user error (Lexical error near "[ a, b, c,#invalid")

js-yaml-event

 invalid_correct
Comments must be separated from other tokens by white space characters
+STR
+DOC ---
+SEQ
=VAL :a
=VAL :b
=VAL :c
-SEQ
-DOC
-STR

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 checkFlowCommentSpace (/node/node_modules/yaml/dist/resolveSeq-4a68b39b.js:1248:17)
    at resolveFlowSeqItems (/node/node_modules/yaml/dist/resolveSeq-4a68b39b.js:2059:7)
    at Object.resolveSeq [as resolve] (/node/node_modules/yaml/dist/resolveSeq-4a68b39b.js:1929:47)
    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)
    at Object.parseAllDocuments (/node/node_modules/yaml/dist/index.js:34:9)

perl-pp-event

 invalid_correct
Line      : 2
Column    : 11
Message   : Invalid plain scalar
Where     : /perl5/lib/perl5/YAML/PP/Lexer.pm line 361
YAML      : "#invalid"
  at /yaml/bin/perl-pp-event line 25.
+STR
+DOC ---
+SEQ
=VAL :a
=VAL :b
=VAL :c

perl-pp-json

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

perl-pp-perl

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

perl-tiny-json

 invalid_correct
YAML::Tiny failed to classify line '[ a, b, c,#invalid' at /yaml/bin/perl-tiny-json line 12.

perl-tiny-perl

 invalid_correct
YAML::Tiny failed to classify line '[ a, b, c,#invalid' at /yaml/bin/perl-tiny-perl line 15.

perl-yaml-json

 invalid_correct
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

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