yaml / yaml-test-suite

Comprehensive, language independent Test Suite for YAML
MIT License
172 stars 58 forks source link

W4TN (Spec Example 9.5. Directives Documents) #34

Closed hvr closed 6 years ago

hvr commented 6 years ago

This test-case is taken from the YAML 1.2 spec, i.e. from http://yaml.org/spec/1.2/spec.html#id2801606 and contains the YAML document(s)

%YAML 1.2
--- |
%!PS-Adobe-2.0
...
%YAML1.2
---
# Empty
...

The relevant productions are

l-directive ::= “%” ( ns-yaml-directive | ns-tag-directive | ns-reserved-directive ) s-l-comments

ns-yaml-directive ::= “Y” “A” “M” “L” s-separate-in-line ns-yaml-version

ns-yaml-version ::= ns-dec-digit+  “.”  ns-dec-digit+

s-separate-in-line ::= s-white+ | /* Start of line */

Iow, s-separate-in-line demands a whitespace between YAML and 1.2

To me this looks like a typo in the example YAML, as it's the only occurence throughout the spec where a white-space was omitted.

perlpunk commented 6 years ago

Good catch! Yeah, I think we should change the test (and the example in the spec)

hvr commented 6 years ago

maybe it'd be even worth adding adding a %YAML1.2 test-case to the "invalid" test-set?

perlpunk commented 6 years ago

yes, that makes sense

perlpunk commented 6 years ago

I'm adding an error test for %YAML1.2 right now

perlpunk commented 6 years ago

tested and pushed, closing, thanks =)