Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

[Component][Yaml] unindented collection - failing test #4226

Closed
wants to merge 1 commit into from

3 participants

@gajdaw

According to http://yaml-online-parser.appspot.com/?yaml=collection%3A%0A-+a%0A++++-+b%0A++++++++-+c&type=python we have another bug in Yaml component.

The commit contains test for this case. The test is currently failing.

I will work on it, but I need some confirmation about Yaml syntax.

Should the output of parsing following Yaml:

collection:
- a
    - b
        - c

be:

array('collection' => array("a - b - c"))
@travisbot

This pull request fails (merged 38c403d into e54f4e4).

@fabpot
Owner

I think this syntax does not make sense and as such I don't see the need to support it.

@gajdaw

I wanted to avoid unnecessary effort. I've checked other Yaml implementations - all of them comply with the above test. Thus I think we should regard it as an error. But I agree with you: it is unnecessary.

Thanks for your opinion.

@fabpot fabpot closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on May 8, 2012
  1. @gajdaw
This page is out of date. Refresh to see the latest.
View
17 src/Symfony/Component/Yaml/Tests/Fixtures/unindentedCollections.yml
@@ -60,3 +60,20 @@ yaml: |
foo: bar
php: |
array('collection' => array('key' => array('a', 'b', 'c'), 'foo' => 'bar'))
+---
+
+#
+# http://yaml-online-parser.appspot.com/?yaml=collection%3A%0A-+a%0A++++-+b%0A++++++++-+c&type=python
+#
+
+test: Unindented collection with faux elements
+brief: >
+ Unindented collection with faux elements
+yaml: |
+ collection:
+ - a
+ - b
+ - c
+php: |
+ array('collection' => array("a - b - c"))
+
Something went wrong with that request. Please try again.