# YAML Test Matrix

--- &test-U99R
  Title: Invalid comma in tag
  Tags: [ error, tag ]

YAML

- !!str, xxx

Expected Events

+STR
+DOC
+SEQ

Expected JSON



dotnet-yamldotnet-event

 invalid_incorrect
+STR
+DOC
+SEQ
=VAL <tag:yaml.org,2002:str,> :xxx
-SEQ
-DOC
-STR

java-snakeyaml-event

 invalid_incorrect
+STR
+DOC
+SEQ
=VAL <tag:yaml.org,2002:str,> :xxx
-SEQ
-DOC
-STR

lua-lyaml-json

 invalid_incorrect
["xxx"]

perl-syck-json

 invalid_incorrect
[
   "xxx"
]

perl-syck-perl

 invalid_incorrect
[
  'xxx'
]

perl-yaml-json

 invalid_incorrect
[
   "xxx"
]

perl-yaml-perl

 invalid_incorrect
[
  'xxx'
]

py-pyyaml-event

 invalid_incorrect
+STR
+DOC
+SEQ
=VAL <tag:yaml.org,2002:str,> :xxx
-SEQ
-DOC
-STR

py-pyyaml-json

 invalid_incorrect
[
  "xxx"
]

py-pyyaml-py

 invalid_incorrect
[GenericScalar(tag='tag:yaml.org,2002:str,', content='xxx')]

py-ruamel-event

 invalid_incorrect
+STR
+DOC
+SEQ
=VAL <tag:yaml.org,2002:str,> :xxx
-SEQ
-DOC
-STR

py-ruamel-json

 invalid_incorrect
[
  "xxx"
]

py-ruamel-py

 invalid_incorrect
[GenericScalar(tag='tag:yaml.org,2002:str,', content='xxx')]

ruby-psych-json

 invalid_incorrect
["xxx"]

c-libfyaml-event

 invalid_correct
stdin:1:8: error: did not find expected '-' indicator
- !!str, xxx
       ^
+STR
+DOC
+SEQ
=VAL <tag:yaml.org,2002:str> :

c-libfyaml-json

 invalid_correct
stdin:1:8: error: did not find expected '-' indicator
- !!str, xxx
       ^

c-libyaml-event

 invalid_correct
Parse error: did not find expected whitespace or line break
+STR
+DOC
+SEQ

cpp-yamlcpp-event

 invalid_correct
Exception:
yaml-cpp: error at line 1, column 8: end of sequence not found
+STR
+DOC
+SEQ
=VAL <tag:yaml.org,2002:str> :

dotnet-yamldotnet-json

 invalid_correct
Unhandled exception. YamlDotNet.Core.YamlException: (Line: 1, Col: 3, Idx: 2) - (Line: 1, Col: 13, Idx: 12): Encountered an unresolved tag 'tag:yaml.org,2002:str,'
   at YamlDotNet.Serialization.NodeTypeResolvers.PreventUnknownTagsNodeTypeResolver.YamlDotNet.Serialization.INodeTypeResolver.Resolve(NodeEvent nodeEvent, Type& currentType)
   at YamlDotNet.Serialization.ValueDeserializers.NodeValueDeserializer.GetTypeFromEvent(NodeEvent nodeEvent, Type currentType)
   at YamlDotNet.Serialization.ValueDeserializers.NodeValueDeserializer.DeserializeValue(IParser parser, Type expectedType, SerializerState state, IValueDeserializer nestedObjectDeserializer)
   at YamlDotNet.Serialization.ValueDeserializers.AliasValueDeserializer.DeserializeValue(IParser parser, Type expectedType, SerializerState state, IValueDeserializer nestedObjectDeserializer)
   at YamlDotNet.Serialization.ValueDeserializers.NodeValueDeserializer.<>c__DisplayClass3_0.<DeserializeValue>b__0(IParser r, Type t)
   at YamlDotNet.Serialization.NodeDeserializers.CollectionNodeDeserializer.DeserializeHelper(Type tItem, IParser parser, Func`3 nestedObjectDeserializer, IList result, Boolean canUpdate)
   at YamlDotNet.Serialization.NodeDeserializers.CollectionNodeDeserializer.YamlDotNet.Serialization.INodeDeserializer.Deserialize(IParser parser, Type expectedType, Func`3 nestedObjectDeserializer, Object& value)
   at YamlDotNet.Serialization.ValueDeserializers.NodeValueDeserializer.DeserializeValue(IParser parser, Type expectedType, SerializerState state, IValueDeserializer nestedObjectDeserializer)
   at YamlDotNet.Serialization.ValueDeserializers.AliasValueDeserializer.DeserializeValue(IParser parser, Type expectedType, SerializerState state, IValueDeserializer nestedObjectDeserializer)
   at YamlDotNet.Serialization.Deserializer.Deserialize(IParser parser, Type type)
   at YamlDotNet.Serialization.Deserializer.Deserialize(TextReader input, Type type)
   at YamlDotNet.Serialization.Deserializer.Deserialize(TextReader input)
   at Program.Main(String[] commandLineArguments)
Aborted (core dumped)

hs-hsyaml-event

 invalid_correct
Parsing error near byte offset Pos {posByteOffset = 1, posCharOffset = 1, posLine = 1, posColumn = 1} (Lexical error near " !!str, xxx")
+STR
+DOC
+SEQ
=VAL :

hs-hsyaml-json

 invalid_correct
hsyaml-parser: user error (Lexical error near " !!str, xxx")

java-snakeyaml-json

 invalid_correct
Exception in thread "main" Can't construct a java object for tag:yaml.org,2002:str,; exception=Class not found: str,
 in 'reader', line 1, column 3:
    - !!str, xxx
      ^

	at org.yaml.snakeyaml.constructor.Constructor$ConstructYamlObject.construct(Constructor.java:336)
	at org.yaml.snakeyaml.constructor.BaseConstructor.constructObjectNoCheck(BaseConstructor.java:230)
	at org.yaml.snakeyaml.constructor.BaseConstructor.constructObject(BaseConstructor.java:220)
	at org.yaml.snakeyaml.constructor.BaseConstructor.constructSequenceStep2(BaseConstructor.java:391)
	at org.yaml.snakeyaml.constructor.BaseConstructor.constructSequence(BaseConstructor.java:375)
	at org.yaml.snakeyaml.constructor.SafeConstructor$ConstructYamlSeq.construct(SafeConstructor.java:534)
	at org.yaml.snakeyaml.constructor.BaseConstructor.constructObjectNoCheck(BaseConstructor.java:230)
	at org.yaml.snakeyaml.constructor.BaseConstructor.constructObject(BaseConstructor.java:220)
	at org.yaml.snakeyaml.constructor.BaseConstructor.constructDocument(BaseConstructor.java:174)
	at org.yaml.snakeyaml.constructor.BaseConstructor.getData(BaseConstructor.java:139)
	at org.yaml.snakeyaml.Yaml$1.next(Yaml.java:514)
	at org.yaml.editor.Snake2Json.yamlToJson(Snake2Json.java:18)
	at org.yaml.editor.Snake2Json.main(Snake2Json.java:25)
Caused by: org.yaml.snakeyaml.error.YAMLException: Class not found: str,
	at org.yaml.snakeyaml.constructor.Constructor.getClassForNode(Constructor.java:669)
	at org.yaml.snakeyaml.constructor.Constructor$ConstructYamlObject.getConstructor(Constructor.java:323)
	at org.yaml.snakeyaml.constructor.Constructor$ConstructYamlObject.construct(Constructor.java:332)
	... 12 more

js-jsyaml-json

 invalid_correct
/node/node_modules/js-yaml/lib/loader.js:187
  throw generateError(state, message);
  ^
YAMLException: tag suffix cannot contain flow indicator characters (1:9)

 1 | - !!str, xxx
-------------^
    at generateError (/node/node_modules/js-yaml/lib/loader.js:183:10)
    at throwError (/node/node_modules/js-yaml/lib/loader.js:187:9)
    at readTagProperty (/node/node_modules/js-yaml/lib/loader.js:1275:7)
    at composeNode (/node/node_modules/js-yaml/lib/loader.js:1407:12)
    at readBlockSequence (/node/node_modules/js-yaml/lib/loader.js:1008:5)
    at composeNode (/node/node_modules/js-yaml/lib/loader.js:1440:12)
    at readDocument (/node/node_modules/js-yaml/lib/loader.js:1625:3)
    at loadDocuments (/node/node_modules/js-yaml/lib/loader.js:1688:5)
    at Object.loadAll (/node/node_modules/js-yaml/lib/loader.js:1701:19)
    at Object.<anonymous> (/yaml/bin/js-jsyaml-json:7:13)

js-yaml-event

 invalid_correct
Tags and anchors must be separated from the next token by white space at line 1, column 8:

- !!str, xxx
       ^
+STR
+DOC
+SEQ

js-yaml-json

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

YAMLParseError: Tags and anchors must be separated from the next token by white space at line 1, column 8:

- !!str, xxx
       ^

    at Composer.onError (/node/node_modules/yaml/dist/compose/composer.js:71:34)
    at Object.resolveProps (/node/node_modules/yaml/dist/compose/resolve-props.js:114:9)
    at Object.resolveBlockSeq (/node/node_modules/yaml/dist/compose/resolve-block-seq.js:10:36)
    at Object.composeCollection (/node/node_modules/yaml/dist/compose/compose-collection.js:17:36)
    at Object.composeNode (/node/node_modules/yaml/dist/compose/compose-node.js:30:38)
    at Object.composeDoc (/node/node_modules/yaml/dist/compose/compose-doc.js:31:23)
    at Composer.next (/node/node_modules/yaml/dist/compose/composer.js:152:40)
    at next (<anonymous>)
    at Composer.compose (/node/node_modules/yaml/dist/compose/composer.js:134:25)
    at compose.next (<anonymous>)

nim-nimyaml-event

 invalid_correct
/tmp/NimYAML-0.16.0/yaml/stream.nim(134) nimyaml_event
/tmp/NimYAML-0.16.0/yaml/stream.nim(106) next
Error: unhandled exception: Unexpected token (expected newline or flow item start: SeqSep [YamlStreamError]
+STR
+DOC
+SEQ

perl-pp-event

 invalid_correct
Line      : 1
Column    : 8
Expected  : EOL WS
Got       : FLOW_COMMA
Where     : /perl5/lib/perl5/YAML/PP/Parser.pm line 392
YAML      : ", xxx\n"
  at /yaml/bin/perl-pp-event line 25.
+STR
+DOC
+SEQ

perl-pp-json

 invalid_correct
Line      : 1
Column    : 8
Expected  : EOL WS
Got       : FLOW_COMMA
Where     : /perl5/lib/perl5/YAML/PP/Parser.pm line 392
YAML      : ", xxx\n"
  at /perl5/lib/perl5/YAML/PP/Loader.pm line 94.

perl-pp-perl

 invalid_correct
Line      : 1
Column    : 8
Expected  : EOL WS
Got       : FLOW_COMMA
Where     : /perl5/lib/perl5/YAML/PP/Parser.pm line 392
YAML      : ", xxx\n"
  at /perl5/lib/perl5/YAML/PP/Loader.pm line 94.

perl-pplibyaml-event

 invalid_correct
YAML::PP::LibYAML Error: The problem:

    did not find expected whitespace or line break

was found at , line: 1, column: 8
while scanning a tag at line: 1, column: 3

perl-pplibyaml-json

 invalid_correct
YAML::PP::LibYAML Error: The problem:

    did not find expected whitespace or line break

was found at , line: 1, column: 8
while scanning a tag at line: 1, column: 3

perl-pplibyaml-perl

 invalid_correct
YAML::PP::LibYAML Error: The problem:

    did not find expected whitespace or line break

was found at , line: 1, column: 8
while scanning a tag at line: 1, column: 3

perl-refparser-event

 invalid_correct
Parser finished before end of input at /perl5/lib/perl5/YAML/Parser.pm line 4047, <> line 1.

perl-tiny-json

 invalid_correct
YAML::Tiny does not support a feature in line '!!str, xxx' at /yaml/bin/perl-tiny-json line 12.

perl-tiny-perl

 invalid_correct
YAML::Tiny does not support a feature in line '!!str, xxx' at /yaml/bin/perl-tiny-perl line 15.

perl-xs-json

 invalid_correct
YAML::XS Error: bad tag found for scalar: 'tag:yaml.org,2002:str,' at /yaml/bin/perl-xs-json line 14, <> line 1.

perl-xs-perl

 invalid_correct
YAML::XS Error: bad tag found for scalar: 'tag:yaml.org,2002:str,' at /yaml/bin/perl-xs-perl line 16, <> line 1.