# YAML Test Matrix

--- &test-2LFX
  Title: Spec Example 6.13. Reserved Directives [1.3]
  Tags: [ 1.3-mod, 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"

cpp-event

 ok

hs-yaml-event

 ok

java-event

 ok

js-event

 ok

nimyaml-event

 ok

perl5-pp-event

 ok

pyyaml-event

 ok

ruamel-event

 ok

hs-yaml-json

 json_ok

java-json

 json_ok

js-json

 json_ok

js-yaml-json

 json_ok

perl5-pp-json

 json_ok

pyyaml-json

 json_ok

ruamel-json

 json_ok

perl5-syck-json

 json_diff
"%FOO  bar baz"
"foo"

libyaml-event

 error
+STR
Parse error: found unknown directive name

luajit-json

 error
luajit: found uknown directive name at document: 0, line: 1, column: 5
while scanning a directive at line: 1, column: 1

stack traceback:
	[C]: in function 'load'
	/bin/luajit-json:6: in main chunk
	[C]: at 0x004044a0

perl5-pegex-event

 error
Error parsing Pegex document:
  msg:      Parse document failed for some reason
  line:     1
  column:   1
  context:  %FOO  bar baz # Should be ignored\n              # 
            ^
  position: 0 (0 pre-lookahead)
 at /bin/perl5-pegex-event line 23.

perl5-pm-json

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

perl5-pm-pl

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

perl5-tiny-json

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

perl5-tiny-pl

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

perl5-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

perl5-xs-pl

 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

ruby-json

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

perl5-pp-pl

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

perl5-syck-pl

 na
'%FOO  bar baz'
'foo'

pyyaml-py

 na
'foo'

ruamel-py

 na
'foo'