yaml-test-suite icon indicating copy to clipboard operation
yaml-test-suite copied to clipboard

Add test for e.g. `[[], :@]`

Open cemerick opened this issue 4 years ago • 1 comments

Some parsers have demonstrated difficulty with colon-prefixed plain scalars within flow sequences, e.g.:

[[], :@]
---
[[], :%]
---
[[], :^]
---
[[], :$]
---
[[], ::]
---
[[], :\t]
---
[[], :`]

These are valid yaml documents, parsed as expected by e.g. libfyaml, libyaml, and others; but e.g. pyyaml, SnakeYAML, YAML:PP, Ruamel, and JS yaml (the last as a result of a regression, now fixed) fail on some or all of them, some requiring the leading flow sequence as the first element in the outer flow sequence, some not.

cemerick avatar Sep 29 '21 04:09 cemerick

https://play.yaml.io/main/parser?input=Wzp4XQ==

[:x] causes the same results across all parsers as all the cases above.

Adding a test for that.

https://play.yaml.io/main/parser?input=Wz94XQ== is another interesting one. Even more parsers get that wrong.

ingydotnet avatar Dec 24 '21 14:12 ingydotnet