# YAML Test Matrix

--- &test-9JBA
  Title: Invalid comment after end of flow sequence
  Tags: [ comment, error, flow, sequence ]

YAML

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

Expected Events

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

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-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:13: error: invalid comment after end of flow sequence
[ a, b, c, ]#invalid
            ^
+STR
+DOC ---

c-libfyaml-json

 invalid_correct
stdin:2:13: error: invalid comment after end of flow sequence
[ 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 ---

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 Object.resolveNode (/node/node_modules/yaml/dist/resolveSeq-4a68b39b.js:1561:7)
    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)
    at Object.<anonymous> (/yaml/bin/js-yaml-json:7:19)
    at Module._compile (internal/modules/cjs/loader.js:778:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
    at Module.load (internal/modules/cjs/loader.js:653:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:593:12)

perl-pp-event

 invalid_correct
Line      : 2
Column    : 13
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
-SEQ

perl-pp-json

 invalid_correct
Line      : 2
Column    : 13
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    : 13
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-syck-json

 invalid_correct
Syck parser (line 2, column 12): syntax error at /perl5/lib/perl5/x86_64-linux-thread-multi/YAML/Syck.pm line 60, <> line 1.

perl-syck-perl

 invalid_correct
Syck parser (line 2, column 12): syntax error at /perl5/lib/perl5/x86_64-linux-thread-multi/YAML/Syck.pm line 60, <> line 1.

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.