# YAML Test Matrix

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

YAML

- !!str, xxx

Expected Events

+STR
+DOC
+SEQ

Expected JSON



c-libyaml-event

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

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

js-yaml-event

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

js-yaml-json

 invalid_incorrect
[
  ", xxx"
]

lua-lyaml-json

 invalid_incorrect
["xxx"]

perl-pplibyaml-event

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

perl-pplibyaml-json

 invalid_incorrect
[
   "xxx"
]

perl-pplibyaml-perl

 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
       ^

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:219)
	at org.yaml.snakeyaml.constructor.BaseConstructor.constructSequenceStep2(BaseConstructor.java:390)
	at org.yaml.snakeyaml.constructor.BaseConstructor.constructSequence(BaseConstructor.java:374)
	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:219)
	at org.yaml.snakeyaml.constructor.BaseConstructor.constructDocument(BaseConstructor.java:173)
	at org.yaml.snakeyaml.constructor.BaseConstructor.getData(BaseConstructor.java:138)
	at org.yaml.snakeyaml.Yaml$1.next(Yaml.java:494)
	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:664)
	at org.yaml.snakeyaml.constructor.Constructor$ConstructYamlObject.getConstructor(Constructor.java:322)
	at org.yaml.snakeyaml.constructor.Constructor$ConstructYamlObject.construct(Constructor.java:331)
	... 12 more

js-jsyaml-json

 invalid_correct
/node/node_modules/js-yaml/lib/js-yaml/loader.js:173
  throw generateError(state, message);
  ^
YAMLException: tag suffix cannot contain flow indicator characters at line 1, column 9:
    - !!str, xxx
            ^
    at generateError (/node/node_modules/js-yaml/lib/js-yaml/loader.js:167:10)
    at throwError (/node/node_modules/js-yaml/lib/js-yaml/loader.js:173:9)
    at readTagProperty (/node/node_modules/js-yaml/lib/js-yaml/loader.js:1200:7)
    at composeNode (/node/node_modules/js-yaml/lib/js-yaml/loader.js:1325:12)
    at readBlockSequence (/node/node_modules/js-yaml/lib/js-yaml/loader.js:955:5)
    at composeNode (/node/node_modules/js-yaml/lib/js-yaml/loader.js:1358:12)
    at readDocument (/node/node_modules/js-yaml/lib/js-yaml/loader.js:1519:3)
    at loadDocuments (/node/node_modules/js-yaml/lib/js-yaml/loader.js:1575:5)
    at Object.loadAll (/node/node_modules/js-yaml/lib/js-yaml/loader.js:1583:19)
    at Object.<anonymous> (/yaml/bin/js-jsyaml-json:7:13)

nim-nimyaml-event

 invalid_correct
/buildutils/nimyaml_event.nim(8) nimyaml_event
/tmp/NimYAML-0.13.1/yaml/stream.nim(223) finished
Error: unhandled exception: Unexpected token: ltComma [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 386
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 386
YAML      : ", xxx\n"
  at /perl5/lib/perl5/YAML/PP/Loader.pm line 92.

perl-pp-perl

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

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.