# YAML Test Matrix

--- &test-U3C3
  Title: Spec Example 6.16. “TAG” directive
  Tags: [ header, spec, tag ]

YAML

%TAG !yaml! tag:yaml.org,2002:
---
!yaml!str "foo"

Expected Events

+STR
+DOC ---
=VAL <tag:yaml.org,2002:str> "foo
-DOC
-STR

Expected JSON

"foo"

c-libfyaml-event

 ok

c-libyaml-event

 ok

cpp-rapidyaml-event

 ok

cpp-yamlcpp-event

 ok

dotnet-yamldotnet-event

 ok

hs-hsyaml-event

 ok

js-yaml-event

 ok

nim-nimyaml-event

 ok

perl-pp-event

 ok

perl-refparser-event

 ok

py-pyyaml-event

 ok

py-ruamel-event

 ok

c-libfyaml-json

 json_ok

dotnet-yamldotnet-json

 json_ok

go-yaml-json

 json_ok

hs-hsyaml-json

 json_ok

js-jsyaml-json

 json_ok

js-yaml-json

 json_ok

lua-lyaml-json

 json_ok

perl-pp-json

 json_ok

perl-pplibyaml-json

 json_ok

perl-xs-json

 json_ok

py-pyyaml-json

 json_ok

py-ruamel-json

 json_ok

ruby-psych-json

 json_ok

rust-yamlrust-event

 diff
Minimal Events:
+STR
+DOC
=VAL <tag:yaml.org,2002:str> "foo
-DOC
-STR
Transformed Events:
+STR
+DOC
=VAL <!yaml!str> "foo
-DOC
-STR
Got Events:
+STR
+DOC
=VAL <!yaml!str> "foo
-DOC
-STR

perl-syck-json

 json_diff
{
  "%TAG !yaml! tag:yaml.org,2002": null
}
"foo"

perl-yaml-json

 error
Use of uninitialized value in sprintf at /perl5/lib/perl5/YAML/Error.pm line 18, <> line 1.
YAML Error: Can't parse inline implicit value ''
   Code: YAML_PARSE_ERR_BAD_INLINE_IMPLICIT
   Line: 1
   Document: 1
 at /perl5/lib/perl5/YAML/Loader.pm line 607.

perl-yaml-perl

 error
Use of uninitialized value in sprintf at /perl5/lib/perl5/YAML/Error.pm line 18, <> line 1.
YAML Error: Can't parse inline implicit value ''
   Code: YAML_PARSE_ERR_BAD_INLINE_IMPLICIT
   Line: 1
   Document: 1
 at /perl5/lib/perl5/YAML/Loader.pm line 607.

hs-reference-yeast

 na
Line  Col Char Byte Token|Content
   1    0    0    0 +DOC |
   1    0    0    0 +DIR |
   1    0    0    0 =SYNX|%
   1    1    1    1 =META|TAG
   1    4    4    4 =WSPC|.
   1    5    5    5 +HAND|
   1    5    5    5 =SYNX|!
   1    6    6    6 =META|yaml
   1   10   10   10 =SYNX|!
   1   11   11   11 -HAND|
   1   11   11   11 =WSPC|.
   1   12   12   12 +TAG |
   1   12   12   12 =META|tag:yaml.org,2002:
   1   30   30   30 -TAG |
   1   30   30   30 -DIR |
   1   30   30   30 =EOL |\x0a
   2    0   31   31 =HEAD|---
   2    3   34   34 =EOL |\x0a
   3    0   35   35 +NODE|
   3    0   35   35 +PROP|
   3    0   35   35 +TAG |
   3    0   35   35 +HAND|
   3    0   35   35 =SYNX|!
   3    1   36   36 =META|yaml
   3    5   40   40 =SYNX|!
   3    6   41   41 -HAND|
   3    6   41   41 =META|str
   3    9   44   44 -TAG |
   3    9   44   44 -PROP|
   3    9   44   44 =WSPC|.
   3   10   45   45 +VAL |
   3   10   45   45 =SYNX|"
   3   11   46   46 =TEXT|foo
   3   14   49   49 =SYNX|"
   3   15   50   50 -VAL |
   3   15   50   50 -NODE|
   3   15   50   50 =EOL |\x0a
   4    0   51   51 -DOC |

perl-pp-perl

 na
'foo'

perl-pplibyaml-perl

 na
'foo'

perl-syck-perl

 na
{
  '%TAG !yaml! tag:yaml.org,2002' => undef
}
'foo'

perl-xs-perl

 na
'foo'

py-pyyaml-py

 na
'foo'

py-ruamel-py

 na
'foo'

perl-tiny-json

 ni
YAML::Tiny failed to classify line '!yaml!str "foo"' at /yaml/bin/perl-tiny-json line 12.

perl-tiny-perl

 ni
YAML::Tiny failed to classify line '!yaml!str "foo"' at /yaml/bin/perl-tiny-perl line 15.