# YAML Test Matrix

--- &test-6LVF
  Title: Spec Example 6.13. Reserved Directives
  Tags: [ 1.3-err, directive, double, header, spec ]

YAML

%FOO  bar baz # Should be ignored
              # with a warning.
--- "foo"

Expected Events

+STR
+DOC ---
=VAL "foo
-DOC
-STR

Expected JSON

"foo"

c-libfyaml-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

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-jsyaml-json

 json_ok

js-yaml-json

 json_ok

perl-pp-json

 json_ok

py-pyyaml-json

 json_ok

py-ruamel-json

 json_ok

perl-syck-json

 json_diff
"%FOO  bar baz"
"foo"

c-libyaml-event

 error
+STR
Parse error: found unknown directive name

lua-lyaml-json

 error
luajit: 1:1: found unknown directive name
stack traceback:
	[C]: in function 'error'
	/usr/local/share/lua/5.1/lyaml/init.lua:291: in function 'error'
	/usr/local/share/lua/5.1/lyaml/init.lua:310: in function 'parse'
	/usr/local/share/lua/5.1/lyaml/init.lua:481: in function 'load'
	/yaml/bin/lua-lyaml-json:6: in main chunk
	[C]: at 0x563220e1af97

perl-pplibyaml-event

 error
YAML::PP::LibYAML Error: The problem:

    found unknown directive name

was found at , line: 1, column: 5
while scanning a directive at line: 1, column: 1

perl-pplibyaml-json

 error
YAML::PP::LibYAML Error: The problem:

    found unknown directive name

was found at , line: 1, column: 5
while scanning a directive at line: 1, column: 1

perl-pplibyaml-perl

 error
YAML::PP::LibYAML Error: The problem:

    found unknown directive name

was found at , line: 1, column: 5
while scanning a directive at line: 1, column: 1

perl-tiny-json

 error
YAML::Tiny failed to classify line '%FOO  bar baz # Should be ignored' at /yaml/bin/perl-tiny-json line 12.

perl-tiny-perl

 error
YAML::Tiny failed to classify line '%FOO  bar baz # Should be ignored' at /yaml/bin/perl-tiny-perl line 15.

perl-xs-json

 error
YAML::XS::Load Error: The problem:

    found unknown directive name

was found at document: 1, line: 1, column: 5
while scanning a directive at line: 1, column: 1

perl-xs-perl

 error
YAML::XS::Load Error: The problem:

    found unknown directive name

was found at document: 1, line: 1, column: 5
while scanning a directive at line: 1, column: 1

perl-yaml-json

 error
YAML Error: Expected separator '---'
   Code: YAML_PARSE_ERR_NO_SEPARATOR
   Line: 1
   Document: 2
 at /perl5/lib/perl5/YAML/Loader.pm line 88.

perl-yaml-perl

 error
YAML Error: Expected separator '---'
   Code: YAML_PARSE_ERR_NO_SEPARATOR
   Line: 1
   Document: 2
 at /perl5/lib/perl5/YAML/Loader.pm line 88.

ruby-psych-json

 error
/usr/lib/ruby/2.5.0/psych.rb:405:in `parse': (<unknown>): found unknown directive name while scanning a directive at line 1 column 1 (Psych::SyntaxError)
	from /usr/lib/ruby/2.5.0/psych.rb:405:in `parse_stream'
	from /usr/lib/ruby/2.5.0/psych.rb:488:in `load_stream'
	from /yaml/bin/ruby-psych-json:6:in `<main>'

perl-pp-perl

 na
'foo'
Found reserved directive '%FOO  bar baz # Should be ignored' at /perl5/lib/perl5/YAML/PP/Lexer.pm line 815, <> line 1.

perl-syck-perl

 na
'%FOO  bar baz'
'foo'

py-pyyaml-py

 na
'foo'

py-ruamel-py

 na
'foo'