# YAML Test Matrix

--- &test-7FWL
  Title: Spec Example 6.24. Verbatim Tags
  Tags: [ spec, tag ]

YAML

!<tag:yaml.org,2002:str> foo :
  !<!bar> baz

Expected Events

+STR
+DOC
+MAP
=VAL <tag:yaml.org,2002:str> :foo
=VAL <!bar> :baz
-MAP
-DOC
-STR

Expected JSON



cpp-event

 ok

hs-yaml-event

 ok

java-event

 ok

js-event

 ok

libyaml-event

 ok

nimyaml-event

 ok

perl5-pp-event

 ok

pyyaml-event

 ok

ruamel-event

 ok

perl5-pegex-event

 diff
Got Events:
+STR
+DOC
+MAP
=VAL <!<tag:yaml.org,2002:str>> :foo
=VAL <!<!bar>> :  !<!bar> baz
-MAP
-DOC
-STR

perl5-pm-pl

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

perl5-tiny-pl

 error
YAML::Tiny failed to classify line '  !<!bar> baz' at /bin/perl5-tiny-pl line 15.

hs-yaml-json

 na
{"foo":"baz"}

java-json

 na
Exception in thread "main" Can't construct a java object for !bar; exception=Invalid tag: !bar
 in 'reader', line 2, column 3:
      !<!bar> baz
      ^

	at org.yaml.snakeyaml.constructor.Constructor$ConstructYamlObject.construct(Constructor.java:314)
	at org.yaml.snakeyaml.constructor.BaseConstructor.constructObjectNoCheck(BaseConstructor.java:204)
	at org.yaml.snakeyaml.constructor.BaseConstructor.constructObject(BaseConstructor.java:193)
	at org.yaml.snakeyaml.constructor.BaseConstructor.constructMapping2ndStep(BaseConstructor.java:453)
	at org.yaml.snakeyaml.constructor.SafeConstructor.constructMapping2ndStep(SafeConstructor.java:184)
	at org.yaml.snakeyaml.constructor.BaseConstructor.constructMapping(BaseConstructor.java:434)
	at org.yaml.snakeyaml.constructor.SafeConstructor$ConstructYamlMap.construct(SafeConstructor.java:521)
	at org.yaml.snakeyaml.constructor.BaseConstructor.constructObjectNoCheck(BaseConstructor.java:204)
	at org.yaml.snakeyaml.constructor.BaseConstructor.constructObject(BaseConstructor.java:193)
	at org.yaml.snakeyaml.constructor.BaseConstructor.constructDocument(BaseConstructor.java:159)
	at org.yaml.snakeyaml.constructor.BaseConstructor.getData(BaseConstructor.java:127)
	at org.yaml.snakeyaml.Yaml$1.next(Yaml.java:547)
	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: Invalid tag: !bar
	at org.yaml.snakeyaml.nodes.Tag.getClassName(Tag.java:112)
	at org.yaml.snakeyaml.constructor.Constructor.getClassForNode(Constructor.java:637)
	at org.yaml.snakeyaml.constructor.Constructor$ConstructYamlObject.getConstructor(Constructor.java:300)
	at org.yaml.snakeyaml.constructor.Constructor$ConstructYamlObject.construct(Constructor.java:309)
	... 13 more

js-json

 na
{
  "foo": "baz"
}

js-yaml-json

 na
YAMLException: end of the stream or a document separator is expected at line 1, column 30:
    !<tag:yaml.org,2002:str> foo :
                                 ^
    at generateError (/node_modules/js-yaml/lib/js-yaml/loader.js:165:10)
    at throwError (/node_modules/js-yaml/lib/js-yaml/loader.js:171:9)
    at readDocument (/node_modules/js-yaml/lib/js-yaml/loader.js:1512:5)
    at loadDocuments (/node_modules/js-yaml/lib/js-yaml/loader.js:1548:5)
    at Object.loadAll (/node_modules/js-yaml/lib/js-yaml/loader.js:1556:19)
    at Object.<anonymous> (/bin/js-yaml-json:6:6)
    at Object.<anonymous> (/bin/js-yaml-json:3:1)
    at Module._compile (module.js:652:30)
    at Object.exports.run (/usr/lib/node_modules/coffee-script/lib/coffee-script/coffee-script.js:173:23)
    at compileScript (/usr/lib/node_modules/coffee-script/lib/coffee-script/command.js:224:29)
    at compilePath (/usr/lib/node_modules/coffee-script/lib/coffee-script/command.js:174:14)
    at Object.exports.run (/usr/lib/node_modules/coffee-script/lib/coffee-script/command.js:98:20)
    at Object.<anonymous> (/usr/lib/node_modules/coffee-script/bin/coffee:15:45)
    at Module._compile (module.js:652:30)
    at Object.Module._extensions..js (module.js:663:10)
    at Module.load (module.js:565:32)
    at tryModuleLoad (module.js:505:12)
    at Function.Module._load (module.js:497:3)
    at Function.Module.runMain (module.js:693:10)
    at startup (bootstrap_node.js:191:16)
    at bootstrap_node.js:612:3

luajit-json

 na
{"foo":"baz"}

perl5-pm-json

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

perl5-pp-json

 na
{
   "foo" : "baz"
}

perl5-pp-pl

 na
{
  'foo' => 'baz'
}

perl5-syck-json

 na
null

perl5-syck-pl

 na
bless( {
         'foo' => 'baz'
       }, '<tag::yaml.org,2002:str>' )

perl5-tiny-json

 na
YAML::Tiny failed to classify line '  !<!bar> baz' at /bin/perl5-tiny-json line 12.

perl5-xs-json

 na
{
   "foo" : "baz"
}

perl5-xs-pl

 na
{
  'foo' => 'baz'
}

pyyaml-json

 na
{
  "foo": "baz"
}

pyyaml-py

 na
{'foo': GenericScalar(tag=u'!bar', content=u'baz')}

ruamel-json

 na
{
  "foo": "baz"
}

ruamel-py

 na
{'foo': GenericScalar(tag=u'!bar', content=u'baz')}

ruby-json

 na
{"foo":"baz"}