# YAML Test Matrix

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

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

{
"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"
}

c-libfyaml-event

 ok

c-libyaml-event

 ok

cpp-yamlcpp-event

 ok

dotnet-yamldotnet-event

 ok

hs-hsyaml-event

 ok

java-snakeyaml-event

 ok

js-yaml-event

 ok

nim-nimyaml-event

 ok

perl-pp-event

 ok

perl-pplibyaml-event

 ok

py-pyyaml-event

 ok

py-ruamel-event

 ok

c-libfyaml-json

 json_ok

hs-hsyaml-json

 json_ok

js-yaml-json

 json_ok

lua-lyaml-json

 json_ok

perl-pp-json

 json_ok

perl-pplibyaml-json

 json_ok

java-snakeyaml-json

 json_diff
parse error: Invalid numeric literal at line 202, column 6

js-jsyaml-json

 json_diff
{
  "canonical": {
    "data": [
      71,
      73,
      70,
      56,
      57,
      97,
      12,
      0,
      12,
      0,
      132,
      0,
      0,
      255,
      255,
      247,
      245,
      245,
      238,
      233,
      233,
      229,
      102,
      102,
      102,
      0,
      0,
      0,
      231,
      231,
      231,
      94,
      94,
      94,
      243,
      243,
      237,
      142,
      142,
      142,
      224,
      224,
      224,
      159,
      159,
      159,
      147,
      147,
      147,
      167,
      167,
      167,
      158,
      158,
      158,
      105,
      105,
      105,
      99,
      99,
      99,
      163,
      163,
      163,
      132,
      132,
      132,
      255,
      254,
      249,
      255,
      254,
      249,
      255,
      254,
      249,
      255,
      254,
      249,
      255,
      254,
      249,
      255,
      254,
      249,
      255,
      254,
      249,
      255,
      254,
      249,
      255,
      254,
      249,
      255,
      254,
      249,
      255,
      254,
      249,
      255,
      254,
      249,
      255,
      254,
      249,
      255,
      254,
      249,
      33,
      254,
      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,
      142,
      129,
      48,
      158,
      227,
      64,
      20,
      232,
      105,
      16,
      196,
      209,
      138,
      8,
      28,
      207,
      128,
      77,
      36,
      122,
      239,
      255,
      48,
      133,
      112,
      184,
      176,
      49,
      102,
      13,
      27,
      206,
      1,
      195,
      1,
      30,
      16,
      39,
      32,
      130,
      10,
      1,
      0,
      59
    ],
    "type": "Buffer"
  },
  "description": "The binary value above is a tiny arrow encoded as a gif image.",
  "generic": {
    "data": [
      71,
      73,
      70,
      56,
      57,
      97,
      12,
      0,
      12,
      0,
      132,
      0,
      0,
      255,
      255,
      247,
      245,
      245,
      238,
      233,
      233,
      229,
      102,
      102,
      102,
      0,
      0,
      0,
      231,
      231,
      231,
      94,
      94,
      94,
      243,
      243,
      237,
      142,
      142,
      142,
      224,
      224,
      224,
      159,
      159,
      159,
      147,
      147,
      147,
      167,
      167,
      167,
      158,
      158,
      158,
      105,
      105,
      105,
      99,
      99,
      99,
      163,
      163,
      163,
      132,
      132,
      132,
      255,
      254,
      249,
      255,
      254,
      249,
      255,
      254,
      249,
      255,
      254,
      249,
      255,
      254,
      249,
      255,
      254,
      249,
      255,
      254,
      249,
      255,
      254,
      249,
      255,
      254,
      249,
      255,
      254,
      249,
      255,
      254,
      249,
      255,
      254,
      249,
      255,
      254,
      249,
      255,
      254,
      249,
      33,
      254,
      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,
      142,
      129,
      48,
      158,
      227,
      64,
      20,
      232,
      105,
      16,
      196,
      209,
      138,
      8,
      28,
      207,
      128,
      77,
      36,
      122,
      239,
      255,
      48,
      133,
      112,
      184,
      176,
      49,
      102,
      13,
      27,
      206,
      1,
      195,
      1,
      30,
      16,
      39,
      32,
      130,
      10,
      1,
      0,
      59
    ],
    "type": "Buffer"
  }
}

perl-syck-json

 json_diff
{
  "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;",
  "description": "The binary value above is a tiny arrow encoded as a gif image.",
  "generic": "GIF89a\f\u0000\f\u0000„\u0000\u0000ÿÿ÷õõîééåfff\u0000\u0000\u0000ççç^^^óó펎ŽàààŸŸ"
}

perl-yaml-json

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

perl-yaml-perl

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

py-pyyaml-json

 error
Error json.dumps: <class 'TypeError'>
Traceback (most recent call last):
  File "/yaml/bin/py-pyyaml-json", line 21, in <module>
    print(json.dumps(doc, sort_keys=True, skipkeys=True, indent=2))
  File "/usr/lib/python3.7/json/__init__.py", line 238, in dumps
    **kw).encode(obj)
  File "/usr/lib/python3.7/json/encoder.py", line 201, in encode
    chunks = list(chunks)
  File "/usr/lib/python3.7/json/encoder.py", line 431, in _iterencode
    yield from _iterencode_dict(o, _current_indent_level)
  File "/usr/lib/python3.7/json/encoder.py", line 405, in _iterencode_dict
    yield from chunks
  File "/usr/lib/python3.7/json/encoder.py", line 438, in _iterencode
    o = _default(o)
  File "/usr/lib/python3.7/json/encoder.py", line 179, in default
    raise TypeError(f'Object of type {o.__class__.__name__} '
TypeError: Object of type bytes is not JSON serializable

py-ruamel-json

 error
Error json.dumps: <class 'TypeError'>
Traceback (most recent call last):
  File "/yaml/bin/py-ruamel-json", line 21, in <module>
    print(json.dumps(doc, sort_keys=True, skipkeys=True, indent=2))
  File "/usr/lib/python3.7/json/__init__.py", line 238, in dumps
    **kw).encode(obj)
  File "/usr/lib/python3.7/json/encoder.py", line 201, in encode
    chunks = list(chunks)
  File "/usr/lib/python3.7/json/encoder.py", line 431, in _iterencode
    yield from _iterencode_dict(o, _current_indent_level)
  File "/usr/lib/python3.7/json/encoder.py", line 405, in _iterencode_dict
    yield from chunks
  File "/usr/lib/python3.7/json/encoder.py", line 438, in _iterencode
    o = _default(o)
  File "/usr/lib/python3.7/json/encoder.py", line 179, in default
    raise TypeError(f'Object of type {o.__class__.__name__} '
TypeError: Object of type bytes is not JSON serializable

ruby-psych-json

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

perl-pp-perl

 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=
'
}

perl-pplibyaml-perl

 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=
'
}

perl-syck-perl

 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���^^^��펎������'
}

py-pyyaml-py

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

py-ruamel-py

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

dotnet-yamldotnet-json

 ni
Unhandled exception. YamlDotNet.Core.YamlException: (Line: 1, Col: 12, Idx: 11) - (Line: 5, Col: 65, Idx: 282): Encountered an unresolved tag 'tag:yaml.org,2002:binary'
   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.DictionaryNodeDeserializer.DeserializeHelper(Type tKey, Type tValue, IParser parser, Func`3 nestedObjectDeserializer, IDictionary result)
   at YamlDotNet.Serialization.NodeDeserializers.DictionaryNodeDeserializer.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)

perl-tiny-json

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

perl-tiny-perl

 ni
YAML::Tiny does not support a feature in line '!!binary "\' at /yaml/bin/perl-tiny-perl line 15.

perl-xs-json

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

perl-xs-perl

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