Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix YAML spec for libyaml 0.2.1 #6285

Closed

Conversation

asterite
Copy link
Member

Fixes #6283

Copy link
Member

@straight-shoota straight-shoota left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this is a good fix because it can hide real errors.

@asterite
Copy link
Member Author

@straight-shoota Suggestions for a good fix? :-)

There's nothing in YAML that can generate "...\n" at the end of the document other than a document. I really don't think we should put a lot more effort into this.

@straight-shoota
Copy link
Member

straight-shoota commented Jun 28, 2018

Take a look at the affected examples. There are very similar examples, which sometimes expect ...\n, sometimes not.

I'd suggest to add an argument flag expect_document_end to assert_yaml_document/assert_built which appends ...\n to the expected string if yaml_get_version is <0.2.1.

@asterite
Copy link
Member Author

Sounds good, but I don't have more time for Crystal today, so someone else should send a PR.

@asterite asterite closed this Jun 28, 2018
@asterite
Copy link
Member Author

It's probably more correct to change the expected string based on the YAML version, so that's another solution. Of course, if later in libyaml 0.2.2 they revert that change because it was a mistake, our code will have to change again.

@straight-shoota
Copy link
Member

Actually, it would probably even be better to normalize the results from YAML::Builder itself. We shouldn't expect different output depending on libyaml version. I expect we will have support these different libyaml versions for quite some time.

@asterite asterite deleted the bug/6283-libyaml-0.2.1 branch June 29, 2018 13:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants