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

Add tests for random attribute order #109

Closed
wants to merge 1 commit into from

Conversation

acecilia
Copy link
Contributor

This is PR to showcase the issue #108. Build should fail due to the DynamicNodeEncodingTest.testEncode() test not passing.

The attributes order is random is because a Swift Dictionary is used to store them. A Dictionary is an unordered collection of keys and values.

In theory, that is fine, as the XML specification says that the order of the attributes is not important.

In practise, the result of this is that the encoding operation is not idempotent: despite using the same model, every time an encoding operation is performed, the resulting XML string has different attributes sorting. This is a major problem in several scenarios, but the most important is during tests.

@acecilia acecilia changed the title Added tests to show bug where the attribute order os random Added tests to show bug where the attribute sorting is random Jun 30, 2019
@MaxDesiatov MaxDesiatov changed the title Added tests to show bug where the attribute sorting is random Add tests for random attribute order Jun 30, 2019
@MaxDesiatov MaxDesiatov self-assigned this Jun 30, 2019
@acecilia
Copy link
Contributor Author

Feel free to close this PR when you do not need it anymore

@MaxDesiatov
Copy link
Collaborator

@acecilia thank you! Can I assume that this is included in #110?

@acecilia
Copy link
Contributor Author

@MaxDesiatov Yes, this is included in #110

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.

2 participants