# YAML Test Matrix

--- &test-FH7J
  Title: Tags on Empty Scalars
  Tags: [ scalar, tag ]

YAML

- !!str
-
  !!null : a
  b: !!str
- !!str : !!null

Expected Events

+STR
+DOC
+SEQ
=VAL <tag:yaml.org,2002:str> :
+MAP
=VAL <tag:yaml.org,2002:null> :
=VAL :a
=VAL :b
=VAL <tag:yaml.org,2002:str> :
-MAP
+MAP
=VAL <tag:yaml.org,2002:str> :
=VAL <tag:yaml.org,2002:null> :
-MAP
-SEQ
-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
+SEQ
=VAL <tag:yaml.org,2002:str> :-
-SEQ
-DOC
+DOC
+MAP
=VAL <tag:yaml.org,2002:null> :
=VAL :a
=VAL :b
=VAL <tag:yaml.org,2002:str> :- !!str
-MAP
-DOC
+DOC
+MAP
=VAL :
=VAL <tag:yaml.org,2002:null> :
-MAP
-DOC
-STR

perl5-syck-pl

 error
Syck parser (line 3, column 10): syntax error at /lib/perl5/x86_64-linux-gnu-thread-multi/YAML/Syck.pm line 75, <> line 1.

perl5-tiny-pl

 error
YAML::Tiny does not support a feature in line '!!str' at /bin/perl5-tiny-pl line 15.

perl5-xs-pl

 error
YAML::XS Error: bad tag found for scalar: 'tag:yaml.org,2002:null' at /bin/perl5-xs-pl line 16, <> line 1.

hs-yaml-json

 na
["",{"":"a","b":""},{"":null}]

java-json

 na
[
  "",
  {
    "null": "a",
    "b": ""
  },
  {}
]

js-json

 na
[
  "",
  {
    "": "a",
    "b": ""
  },
  {
    "": null
  }
]

js-yaml-json

 na
YAMLException: bad indentation of a sequence entry at line 3, column 10:
      !!null : a
             ^
    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 readBlockSequence (/node_modules/js-yaml/lib/js-yaml/loader.js:935:7)
    at composeNode (/node_modules/js-yaml/lib/js-yaml/loader.js:1331:12)
    at readDocument (/node_modules/js-yaml/lib/js-yaml/loader.js:1492:3)
    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
["",{"":"a","b":""},{"":""}]

perl5-pm-json

 na
[
   null,
   {
      "" : "a",
      "b" : null
   },
   ": !!null"
]

perl5-pm-pl

 na
[
  undef,
  {
    '' => 'a',
    'b' => undef
  },
  ': !!null'
]

perl5-pp-json

 na
[
   "",
   {
      "" : "a",
      "b" : ""
   },
   {
      "" : null
   }
]

perl5-pp-pl

 na
[
  '',
  {
    '' => 'a',
    'b' => ''
  },
  {
    '' => undef
  }
]

perl5-syck-json

 na
Syck parser (line 3, column 10): syntax error at /lib/perl5/x86_64-linux-gnu-thread-multi/YAML/Syck.pm line 75, <> line 1.

perl5-tiny-json

 na
YAML::Tiny does not support a feature in line '!!str' at /bin/perl5-tiny-json line 12.

perl5-xs-json

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

pyyaml-json

 na
[
  "", 
  {
    "null": "a", 
    "b": ""
  }, 
  {
    "": null
  }
]

pyyaml-py

 na
['', {None: 'a', 'b': ''}, {'': None}]

ruamel-json

 na
[
  "", 
  {
    "null": "a", 
    "b": ""
  }, 
  {
    "": null
  }
]

ruamel-py

 na
['', {None: 'a', 'b': ''}, {'': None}]

ruby-json

 na
["",{"":"a","b":""},{"":null}]