yaml / yaml-test-suite

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

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

Open cemerick opened 2 years ago

cemerick commented 2 years ago

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.

ingydotnet commented 2 years ago

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.