# YAML Test Matrix

--- &test-565N
  Title: Construct Binary
  Tags: [ jayt ]

YAML

canonical: !!binary "\
 R0lGODlhDAAMAIQAAP//9/X17unp5WZmZgAAAOfn515eXvPz7Y6OjuDg4J+fn5\
 OTk6enp56enmlpaWNjY6Ojo4SEhP/++f/++f/++f/++f/++f/++f/++f/++f/+\
 +f/++f/++f/++f/++f/++SH+Dk1hZGUgd2l0aCBHSU1QACwAAAAADAAMAAAFLC\
 AgjoEwnuNAFOhpEMTRiggcz4BNJHrv/zCFcLiwMWYNG84BwwEeECcgggoBADs="
generic: !!binary |
 R0lGODlhDAAMAIQAAP//9/X17unp5WZmZgAAAOfn515eXvPz7Y6OjuDg4J+fn5
 OTk6enp56enmlpaWNjY6Ojo4SEhP/++f/++f/++f/++f/++f/++f/++f/++f/+
 +f/++f/++f/++f/++f/++SH+Dk1hZGUgd2l0aCBHSU1QACwAAAAADAAMAAAFLC
 AgjoEwnuNAFOhpEMTRiggcz4BNJHrv/zCFcLiwMWYNG84BwwEeECcgggoBADs=
description:
 The binary value above is a tiny arrow encoded as a gif image.

Expected Events

+STR
+DOC
+MAP
=VAL :canonical
=VAL <tag:yaml.org,2002:binary> "R0lGODlhDAAMAIQAAP//9/X17unp5WZmZgAAAOfn515eXvPz7Y6OjuDg4J+fn5OTk6enp56enmlpaWNjY6Ojo4SEhP/++f/++f/++f/++f/++f/++f/++f/++f/++f/++f/++f/++f/++f/++SH+Dk1hZGUgd2l0aCBHSU1QACwAAAAADAAMAAAFLCAgjoEwnuNAFOhpEMTRiggcz4BNJHrv/zCFcLiwMWYNG84BwwEeECcgggoBADs=
=VAL :generic
=VAL <tag:yaml.org,2002:binary> |R0lGODlhDAAMAIQAAP//9/X17unp5WZmZgAAAOfn515eXvPz7Y6OjuDg4J+fn5\nOTk6enp56enmlpaWNjY6Ojo4SEhP/++f/++f/++f/++f/++f/++f/++f/++f/+\n+f/++f/++f/++f/++f/++SH+Dk1hZGUgd2l0aCBHSU1QACwAAAAADAAMAAAFLC\nAgjoEwnuNAFOhpEMTRiggcz4BNJHrv/zCFcLiwMWYNG84BwwEeECcgggoBADs=\n
=VAL :description
=VAL :The binary value above is a tiny arrow encoded as a gif image.
-MAP
-DOC
-STR

Expected JSON



cpp-event

 ok

hs-yaml-event

 ok

java-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 :canonical
=VAL <tag:yaml.org,2002:binary> "\ R0lGODlhDAAMAIQAAP//9/X17unp5WZmZgAAAOfn515eXvPz7Y6OjuDg4J+fn5\ OTk6enp56enmlpaWNjY6Ojo4SEhP/++f/++f/++f/++f/++f/++f/++f/++f/+\ +f/++f/++f/++f/++f/++SH+Dk1hZGUgd2l0aCBHSU1QACwAAAAADAAMAAAFLC\ AgjoEwnuNAFOhpEMTRiggcz4BNJHrv/zCFcLiwMWYNG84BwwEeECcgggoBADs=
=VAL :generic
=VAL <tag:yaml.org,2002:binary> |R0lGODlhDAAMAIQAAP//9/X17unp5WZmZgAAAOfn515eXvPz7Y6OjuDg4J+fn5\nOTk6enp56enmlpaWNjY6Ojo4SEhP/++f/++f/++f/++f/++f/++f/++f/++f/+\n+f/++f/++f/++f/++f/++SH+Dk1hZGUgd2l0aCBHSU1QACwAAAAADAAMAAAFLC\nAgjoEwnuNAFOhpEMTRiggcz4BNJHrv/zCFcLiwMWYNG84BwwEeECcgggoBADs=\n
=VAL :description
=VAL : The binary value above is a tiny arrow encoded as a gif image.
-MAP
-DOC
-STR

js-yaml-json

 error
TypeError: this is not a typed array.
    at Function.from (native)
    at Type.constructYamlBinary [as construct] (/node_modules/js-yaml/lib/js-yaml/type/binary.js:80:41)
    at composeNode (/node_modules/js-yaml/lib/js-yaml/loader.js:1395:29)
    at readBlockMapping (/node_modules/js-yaml/lib/js-yaml/loader.js:1062:11)
    at composeNode (/node_modules/js-yaml/lib/js-yaml/loader.js:1332: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:410:26)
    at Object.exports.run (/usr/local/lib/node_modules/coffee-script/lib/coffee-script/coffee-script.js:173:23)
    at compileScript (/usr/local/lib/node_modules/coffee-script/lib/coffee-script/command.js:224:29)
    at compilePath (/usr/local/lib/node_modules/coffee-script/lib/coffee-script/command.js:174:14)
    at Object.exports.run (/usr/local/lib/node_modules/coffee-script/lib/coffee-script/command.js:98:20)
    at Object.<anonymous> (/usr/local/lib/node_modules/coffee-script/bin/coffee:15:45)
    at Module._compile (module.js:410:26)
    at Object.Module._extensions..js (module.js:417:10)
    at Module.load (module.js:344:32)
    at Function.Module._load (module.js:301:12)
    at Function.Module.runMain (module.js:442:10)
    at startup (node.js:136:18)
    at node.js:966:3

perl5-pm-json

 error
YAML Error: Inconsistent indentation level
   Code: YAML_PARSE_ERR_INCONSISTENT_INDENTATION
   Line: 2
   Document: 1
 at /lib/perl5/YAML/Loader.pm line 804.

perl5-pm-pl

 error
YAML Error: Inconsistent indentation level
   Code: YAML_PARSE_ERR_INCONSISTENT_INDENTATION
   Line: 2
   Document: 1
 at /lib/perl5/YAML/Loader.pm line 804.

perl5-tiny-json

 error
YAML::Tiny does not support a feature in line '!!binary "\' at /bin/perl5-tiny-json line 12.

perl5-tiny-pl

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

perl5-xs-json

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

perl5-xs-pl

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

pyyaml-json

 error
Error json.dumps: <type 'exceptions.UnicodeDecodeError'>
Traceback (most recent call last):
  File "/bin/pyyaml-json", line 21, in <module>
    print json.dumps(doc, sort_keys=True, skipkeys=True, indent=2)
  File "/usr/lib/python2.7/json/__init__.py", line 251, in dumps
    sort_keys=sort_keys, **kw).encode(obj)
  File "/usr/lib/python2.7/json/encoder.py", line 209, in encode
    chunks = list(chunks)
  File "/usr/lib/python2.7/json/encoder.py", line 434, in _iterencode
    for chunk in _iterencode_dict(o, _current_indent_level):
  File "/usr/lib/python2.7/json/encoder.py", line 390, in _iterencode_dict
    yield _encoder(value)
UnicodeDecodeError: 'utf8' codec can't decode byte 0x84 in position 10: invalid start byte

ruamel-json

 error
Error json.dumps: <type 'exceptions.UnicodeDecodeError'>
Traceback (most recent call last):
  File "/bin/ruamel-json", line 21, in <module>
    print json.dumps(doc, sort_keys=True, skipkeys=True, indent=2)
  File "/usr/lib/python2.7/json/__init__.py", line 251, in dumps
    sort_keys=sort_keys, **kw).encode(obj)
  File "/usr/lib/python2.7/json/encoder.py", line 209, in encode
    chunks = list(chunks)
  File "/usr/lib/python2.7/json/encoder.py", line 434, in _iterencode
    for chunk in _iterencode_dict(o, _current_indent_level):
  File "/usr/lib/python2.7/json/encoder.py", line 390, in _iterencode_dict
    yield _encoder(value)
UnicodeDecodeError: 'utf8' codec can't decode byte 0x84 in position 10: invalid start byte

ruby-json

 error
/usr/lib/ruby/vendor_ruby/json/common.rb:223:in `encode': "\x84" from ASCII-8BIT to UTF-8 (Encoding::UndefinedConversionError)
	from /usr/lib/ruby/vendor_ruby/json/common.rb:223:in `generate'
	from /usr/lib/ruby/vendor_ruby/json/common.rb:223:in `generate'
	from /usr/lib/ruby/vendor_ruby/json/common.rb:394:in `dump'
	from /bin/ruby-json:7:in `block in <main>'
	from /bin/ruby-json:6:in `each'
	from /bin/ruby-json:6:in `<main>'

hs-yaml-json

 na
{"canonical":"R0lGODlhDAAMAIQAAP//9/X17unp5WZmZgAAAOfn515eXvPz7Y6OjuDg4J+fn5OTk6enp56enmlpaWNjY6Ojo4SEhP/++f/++f/++f/++f/++f/++f/++f/++f/++f/++f/++f/++f/++f/++SH+Dk1hZGUgd2l0aCBHSU1QACwAAAAADAAMAAAFLCAgjoEwnuNAFOhpEMTRiggcz4BNJHrv/zCFcLiwMWYNG84BwwEeECcgggoBADs=","description":"The binary value above is a tiny arrow encoded as a gif image.","generic":"R0lGODlhDAAMAIQAAP//9/X17unp5WZmZgAAAOfn515eXvPz7Y6OjuDg4J+fn5\nOTk6enp56enmlpaWNjY6Ojo4SEhP/++f/++f/++f/++f/++f/++f/++f/++f/+\n+f/++f/++f/++f/++f/++SH+Dk1hZGUgd2l0aCBHSU1QACwAAAAADAAMAAAFLC\nAgjoEwnuNAFOhpEMTRiggcz4BNJHrv/zCFcLiwMWYNG84BwwEeECcgggoBADs=\n"}

java-json

 na
{
  "canonical": [
    71,
    73,
    70,
    56,
    57,
    97,
    12,
    0,
    12,
    0,
    -124,
    0,
    0,
    -1,
    -1,
    -9,
    -11,
    -11,
    -18,
    -23,
    -23,
    -27,
    102,
    102,
    102,
    0,
    0,
    0,
    -25,
    -25,
    -25,
    94,
    94,
    94,
    -13,
    -13,
    -19,
    -114,
    -114,
    -114,
    -32,
    -32,
    -32,
    -97,
    -97,
    -97,
    -109,
    -109,
    -109,
    -89,
    -89,
    -89,
    -98,
    -98,
    -98,
    105,
    105,
    105,
    99,
    99,
    99,
    -93,
    -93,
    -93,
    -124,
    -124,
    -124,
    -1,
    -2,
    -7,
    -1,
    -2,
    -7,
    -1,
    -2,
    -7,
    -1,
    -2,
    -7,
    -1,
    -2,
    -7,
    -1,
    -2,
    -7,
    -1,
    -2,
    -7,
    -1,
    -2,
    -7,
    -1,
    -2,
    -7,
    -1,
    -2,
    -7,
    -1,
    -2,
    -7,
    -1,
    -2,
    -7,
    -1,
    -2,
    -7,
    -1,
    -2,
    -7,
    33,
    -2,
    14,
    77,
    97,
    100,
    101,
    32,
    119,
    105,
    116,
    104,
    32,
    71,
    73,
    77,
    80,
    0,
    44,
    0,
    0,
    0,
    0,
    12,
    0,
    12,
    0,
    0,
    5,
    44,
    32,
    32,
    -114,
    -127,
    48,
    -98,
    -29,
    64,
    20,
    -24,
    105,
    16,
    -60,
    -47,
    -118,
    8,
    28,
    -49,
    -128,
    77,
    36,
    122,
    -17,
    -1,
    48,
    -123,
    112,
    -72,
    -80,
    49,
    102,
    13,
    27,
    -50,
    1,
    -61,
    1,
    30,
    16,
    39,
    32,
    -126,
    10,
    1,
    0,
    59
  ],
  "generic": [
    71,
    73,
    70,
    56,
    57,
    97,
    12,
    0,
    12,
    0,
    -124,
    0,
----- 8< -----

luajit-json

 na
{"canonical":"GIF89a\f\u0000\f\u0000�\u0000\u0000���������fff\u0000\u0000\u0000���^^^��펎����������������iiiccc������������������������������������������������!�\u000eMade with GIMP\u0000,\u0000\u0000\u0000\u0000\f\u0000\f\u0000\u0000\u0005,  ��0��@\u0014�i\u0010�ъ\b\u001cπM$z��0�p��1f\r\u001b�\u0001�\u0001\u001e\u0010' �\n\u0001\u0000;","generic":"GIF89a\f\u0000\f\u0000�\u0000\u0000���������fff\u0000\u0000\u0000���^^^��펎����������������iiiccc������������������������������������������������!�\u000eMade with GIMP\u0000,\u0000\u0000\u0000\u0000\f\u0000\f\u0000\u0000\u0005,  ��0��@\u0014�i\u0010�ъ\b\u001cπM$z��0�p��1f\r\u001b�\u0001�\u0001\u001e\u0010' �\n\u0001\u0000;","description":"The binary value above is a tiny arrow encoded as a gif image."}

perl5-pp-json

 na
{
   "canonical" : "R0lGODlhDAAMAIQAAP//9/X17unp5WZmZgAAAOfn515eXvPz7Y6OjuDg4J+fn5OTk6enp56enmlpaWNjY6Ojo4SEhP/++f/++f/++f/++f/++f/++f/++f/++f/++f/++f/++f/++f/++f/++SH+Dk1hZGUgd2l0aCBHSU1QACwAAAAADAAMAAAFLCAgjoEwnuNAFOhpEMTRiggcz4BNJHrv/zCFcLiwMWYNG84BwwEeECcgggoBADs=",
   "description" : "The binary value above is a tiny arrow encoded as a gif image.",
   "generic" : "R0lGODlhDAAMAIQAAP//9/X17unp5WZmZgAAAOfn515eXvPz7Y6OjuDg4J+fn5\nOTk6enp56enmlpaWNjY6Ojo4SEhP/++f/++f/++f/++f/++f/++f/++f/++f/+\n+f/++f/++f/++f/++f/++SH+Dk1hZGUgd2l0aCBHSU1QACwAAAAADAAMAAAFLC\nAgjoEwnuNAFOhpEMTRiggcz4BNJHrv/zCFcLiwMWYNG84BwwEeECcgggoBADs=\n"
}

perl5-pp-pl

 na
{
  'canonical' => 'R0lGODlhDAAMAIQAAP//9/X17unp5WZmZgAAAOfn515eXvPz7Y6OjuDg4J+fn5OTk6enp56enmlpaWNjY6Ojo4SEhP/++f/++f/++f/++f/++f/++f/++f/++f/++f/++f/++f/++f/++f/++SH+Dk1hZGUgd2l0aCBHSU1QACwAAAAADAAMAAAFLCAgjoEwnuNAFOhpEMTRiggcz4BNJHrv/zCFcLiwMWYNG84BwwEeECcgggoBADs=',
  'description' => 'The binary value above is a tiny arrow encoded as a gif image.',
  'generic' => 'R0lGODlhDAAMAIQAAP//9/X17unp5WZmZgAAAOfn515eXvPz7Y6OjuDg4J+fn5
OTk6enp56enmlpaWNjY6Ojo4SEhP/++f/++f/++f/++f/++f/++f/++f/++f/+
+f/++f/++f/++f/++f/++SH+Dk1hZGUgd2l0aCBHSU1QACwAAAAADAAMAAAFLC
AgjoEwnuNAFOhpEMTRiggcz4BNJHrv/zCFcLiwMWYNG84BwwEeECcgggoBADs=
'
}

perl5-syck-json

 na
{
   "canonical" : "GIF89a\f\u0000\f\u0000\u0084\u0000\u0000\u00ff\u00ff\u00f7\u00f5\u00f5\u00ee\u00e9\u00e9\u00e5fff\u0000\u0000\u0000\u00e7\u00e7\u00e7^^^\u00f3\u00f3\u00ed\u008e\u008e\u008e\u00e0\u00e0\u00e0\u009f\u009f\u009f\u0093\u0093\u0093\u00a7\u00a7\u00a7\u009e\u009e\u009eiiiccc\u00a3\u00a3\u00a3\u0084\u0084\u0084\u00ff\u00fe\u00f9\u00ff\u00fe\u00f9\u00ff\u00fe\u00f9\u00ff\u00fe\u00f9\u00ff\u00fe\u00f9\u00ff\u00fe\u00f9\u00ff\u00fe\u00f9\u00ff\u00fe\u00f9\u00ff\u00fe\u00f9\u00ff\u00fe\u00f9\u00ff\u00fe\u00f9\u00ff\u00fe\u00f9\u00ff\u00fe\u00f9\u00ff\u00fe\u00f9!\u00fe\u000eMade with GIMP\u0000,\u0000\u0000\u0000\u0000\f\u0000\f\u0000\u0000\u0005,  \u008e\u00810\u009e\u00e3@\u0014\u00e8i\u0010\u00c4\u00d1\u008a\b\u001c\u00cf\u0080M$z\u00ef\u00ff0\u0085p\u00b8\u00b01f\r\u001b\u00ce\u0001\u00c3\u0001\u001e\u0010' \u0082\n\u0001\u0000;",
   "description" : "The binary value above is a tiny arrow encoded as a gif image.",
   "generic" : "GIF89a\f\u0000\f\u0000\u0084\u0000\u0000\u00ff\u00ff\u00f7\u00f5\u00f5\u00ee\u00e9\u00e9\u00e5fff\u0000\u0000\u0000\u00e7\u00e7\u00e7^^^\u00f3\u00f3\u00ed\u008e\u008e\u008e\u00e0\u00e0\u00e0\u009f\u009f"
}

perl5-syck-pl

 na
{
  'canonical' => 'GIF89a����������fff���^^^��펎����������������iiiccc������������������������������������������������!�Made with GIMP,,  ��0��@�i�ъπM$z��0�p��1f
��\' �
;',
  'description' => 'The binary value above is a tiny arrow encoded as a gif image.',
  'generic' => 'GIF89a����������fff���^^^��펎������'
}

pyyaml-py

 na
{'canonical': "GIF89a\x0c\x00\x0c\x00\x84\x00\x00\xff\xff\xf7\xf5\xf5\xee\xe9\xe9\xe5fff\x00\x00\x00\xe7\xe7\xe7^^^\xf3\xf3\xed\x8e\x8e\x8e\xe0\xe0\xe0\x9f\x9f\x9f\x93\x93\x93\xa7\xa7\xa7\x9e\x9e\x9eiiiccc\xa3\xa3\xa3\x84\x84\x84\xff\xfe\xf9\xff\xfe\xf9\xff\xfe\xf9\xff\xfe\xf9\xff\xfe\xf9\xff\xfe\xf9\xff\xfe\xf9\xff\xfe\xf9\xff\xfe\xf9\xff\xfe\xf9\xff\xfe\xf9\xff\xfe\xf9\xff\xfe\xf9\xff\xfe\xf9!\xfe\x0eMade with GIMP\x00,\x00\x00\x00\x00\x0c\x00\x0c\x00\x00\x05,  \x8e\x810\x9e\xe3@\x14\xe8i\x10\xc4\xd1\x8a\x08\x1c\xcf\x80M$z\xef\xff0\x85p\xb8\xb01f\r\x1b\xce\x01\xc3\x01\x1e\x10' \x82\n\x01\x00;",
 'description': 'The binary value above is a tiny arrow encoded as a gif image.',
 'generic': "GIF89a\x0c\x00\x0c\x00\x84\x00\x00\xff\xff\xf7\xf5\xf5\xee\xe9\xe9\xe5fff\x00\x00\x00\xe7\xe7\xe7^^^\xf3\xf3\xed\x8e\x8e\x8e\xe0\xe0\xe0\x9f\x9f\x9f\x93\x93\x93\xa7\xa7\xa7\x9e\x9e\x9eiiiccc\xa3\xa3\xa3\x84\x84\x84\xff\xfe\xf9\xff\xfe\xf9\xff\xfe\xf9\xff\xfe\xf9\xff\xfe\xf9\xff\xfe\xf9\xff\xfe\xf9\xff\xfe\xf9\xff\xfe\xf9\xff\xfe\xf9\xff\xfe\xf9\xff\xfe\xf9\xff\xfe\xf9\xff\xfe\xf9!\xfe\x0eMade with GIMP\x00,\x00\x00\x00\x00\x0c\x00\x0c\x00\x00\x05,  \x8e\x810\x9e\xe3@\x14\xe8i\x10\xc4\xd1\x8a\x08\x1c\xcf\x80M$z\xef\xff0\x85p\xb8\xb01f\r\x1b\xce\x01\xc3\x01\x1e\x10' \x82\n\x01\x00;"}

ruamel-py

 na
{'canonical': "GIF89a\x0c\x00\x0c\x00\x84\x00\x00\xff\xff\xf7\xf5\xf5\xee\xe9\xe9\xe5fff\x00\x00\x00\xe7\xe7\xe7^^^\xf3\xf3\xed\x8e\x8e\x8e\xe0\xe0\xe0\x9f\x9f\x9f\x93\x93\x93\xa7\xa7\xa7\x9e\x9e\x9eiiiccc\xa3\xa3\xa3\x84\x84\x84\xff\xfe\xf9\xff\xfe\xf9\xff\xfe\xf9\xff\xfe\xf9\xff\xfe\xf9\xff\xfe\xf9\xff\xfe\xf9\xff\xfe\xf9\xff\xfe\xf9\xff\xfe\xf9\xff\xfe\xf9\xff\xfe\xf9\xff\xfe\xf9\xff\xfe\xf9!\xfe\x0eMade with GIMP\x00,\x00\x00\x00\x00\x0c\x00\x0c\x00\x00\x05,  \x8e\x810\x9e\xe3@\x14\xe8i\x10\xc4\xd1\x8a\x08\x1c\xcf\x80M$z\xef\xff0\x85p\xb8\xb01f\r\x1b\xce\x01\xc3\x01\x1e\x10' \x82\n\x01\x00;",
 'description': 'The binary value above is a tiny arrow encoded as a gif image.',
 'generic': "GIF89a\x0c\x00\x0c\x00\x84\x00\x00\xff\xff\xf7\xf5\xf5\xee\xe9\xe9\xe5fff\x00\x00\x00\xe7\xe7\xe7^^^\xf3\xf3\xed\x8e\x8e\x8e\xe0\xe0\xe0\x9f\x9f\x9f\x93\x93\x93\xa7\xa7\xa7\x9e\x9e\x9eiiiccc\xa3\xa3\xa3\x84\x84\x84\xff\xfe\xf9\xff\xfe\xf9\xff\xfe\xf9\xff\xfe\xf9\xff\xfe\xf9\xff\xfe\xf9\xff\xfe\xf9\xff\xfe\xf9\xff\xfe\xf9\xff\xfe\xf9\xff\xfe\xf9\xff\xfe\xf9\xff\xfe\xf9\xff\xfe\xf9!\xfe\x0eMade with GIMP\x00,\x00\x00\x00\x00\x0c\x00\x0c\x00\x00\x05,  \x8e\x810\x9e\xe3@\x14\xe8i\x10\xc4\xd1\x8a\x08\x1c\xcf\x80M$z\xef\xff0\x85p\xb8\xb01f\r\x1b\xce\x01\xc3\x01\x1e\x10' \x82\n\x01\x00;"}