# YAML Test Matrix

--- &test-74H7
  Title: Tags in Implicit Mapping
  Tags: [ mapping, tag ]

YAML

!!str a: b
c: !!int 42
e: !!str f
g: h
!!str 23: !!bool false

Expected Events

+STR
+DOC
+MAP
=VAL <tag:yaml.org,2002:str> :a
=VAL :b
=VAL :c
=VAL <tag:yaml.org,2002:int> :42
=VAL :e
=VAL <tag:yaml.org,2002:str> :f
=VAL :g
=VAL :h
=VAL <tag:yaml.org,2002:str> :23
=VAL <tag:yaml.org,2002:bool> :false
-MAP
-DOC
-STR

Expected JSON

{
"23": false,
"a": "b",
"c": 42,
"e": "f",
"g": "h"
}

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

perl-refparser-event

 ok

py-pyyaml-event

 ok

py-ruamel-event

 ok

c-libfyaml-json

 json_ok

dotnet-yamldotnet-json

 json_ok

hs-hsyaml-json

 json_ok

java-snakeyaml-json

 json_ok

js-yaml-json

 json_ok

lua-lyaml-json

 json_ok

perl-pp-json

 json_ok

perl-pplibyaml-json

 json_ok

py-pyyaml-json

 json_ok

py-ruamel-json

 json_ok

ruby-psych-json

 json_ok

perl-syck-json

 json_diff
{
  "23": "false",
  "a": "b",
  "c": 42,
  "e": "f",
  "g": "h"
}

perl-yaml-json

 json_diff
{
  "23": "false",
  "a": "b",
  "c": 42,
  "e": "f",
  "g": "h"
}

js-jsyaml-json

 error
/node/node_modules/js-yaml/lib/loader.js:187
  throw generateError(state, message);
  ^
YAMLException: end of the stream or a document separator is expected (1:8)

 1 | !!str a: b
------------^
 2 | c: !!int 42
 3 | e: !!str f
    at generateError (/node/node_modules/js-yaml/lib/loader.js:183:10)
    at throwError (/node/node_modules/js-yaml/lib/loader.js:187:9)
    at readDocument (/node/node_modules/js-yaml/lib/loader.js:1645:5)
    at loadDocuments (/node/node_modules/js-yaml/lib/loader.js:1688:5)
    at Object.loadAll (/node/node_modules/js-yaml/lib/loader.js:1701:19)
    at Object.<anonymous> (/yaml/bin/js-jsyaml-json:7:13)
    at Module._compile (internal/modules/cjs/loader.js:778:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
    at Module.load (internal/modules/cjs/loader.js:653:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:593:12)

perl-xs-json

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

perl-xs-perl

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

perl-pp-perl

 na
{
  '23' => bless( do{\(my $o = 0)}, 'JSON::PP::Boolean' ),
  'a' => 'b',
  'c' => 42,
  'e' => 'f',
  'g' => 'h'
}

perl-pplibyaml-perl

 na
{
  '23' => bless( do{\(my $o = 0)}, 'JSON::PP::Boolean' ),
  'a' => 'b',
  'c' => 42,
  'e' => 'f',
  'g' => 'h'
}

perl-syck-perl

 na
{
  '23' => 'false',
  'a' => 'b',
  'c' => 42,
  'e' => 'f',
  'g' => 'h'
}

perl-yaml-perl

 na
{
  '23' => 'false',
  'a' => 'b',
  'c' => 42,
  'e' => 'f',
  'g' => 'h'
}

py-pyyaml-py

 na
{'23': False, 'a': 'b', 'c': 42, 'e': 'f', 'g': 'h'}

py-ruamel-py

 na
{'23': False, 'a': 'b', 'c': 42, 'e': 'f', 'g': 'h'}

perl-tiny-json

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

perl-tiny-perl

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