yaml / yaml-test-suite

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

Remove incorrect block indentation indicator from 7T8X out-yaml #27

Closed eemeli closed 4 years ago

eemeli commented 6 years ago

The 2 indentation indicator is unnecessary, and therefore against the guideline given at least in the 1.2 version of the spec:

It is always valid to specify an indentation indicator for a block scalar node, though a YAML processor should only emit an explicit indentation indicator for cases where detection will fail.

Furthermore, the 2 in this case doesn't even match the actual indentation of the contents. As "Document nodes are indented as if they have a parent indented at -1 spaces", and the example uses two spaces for indentation, the indicator here would need to be 3 for the in.yaml and out.yaml contents to match.

perlpunk commented 6 years ago

I agree that the 2 should be removed. The out.yaml was generated by libyaml, so it seems libyaml is doing the "wrong" thing here. It seems to happen only if the first line is empty. @ingydotnet @flyx any idea why libyaml is doing this?

I also agree that logically, it should be a 3, although that doesn't make much sense from a user perspective.

perlpunk commented 4 years ago

Thanks! merged to release branch