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

Encode element with empty key, empty element, and attributes #223

Merged
merged 6 commits into from
Aug 5, 2021

Conversation

wooj2
Copy link
Contributor

@wooj2 wooj2 commented Aug 2, 2021

Original description is in this issue:
#224

@codecov
Copy link

codecov bot commented Aug 2, 2021

Codecov Report

Merging #223 (bc89de7) into main (487ece5) will increase coverage by 0.06%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #223      +/-   ##
==========================================
+ Coverage   73.87%   73.94%   +0.06%     
==========================================
  Files          46       46              
  Lines        2431     2437       +6     
==========================================
+ Hits         1796     1802       +6     
  Misses        635      635              
Impacted Files Coverage Δ
Sources/XMLCoder/Auxiliaries/XMLCoderElement.swift 96.49% <100.00%> (+0.09%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 487ece5...bc89de7. Read the comment docs.

@MaxDesiatov MaxDesiatov changed the title fix: encode element with empty key, empty element, and attributes Encode element with empty key, empty element, and attributes Aug 3, 2021
@@ -217,9 +217,16 @@ struct XMLCoderElement: Equatable {
_ string: inout String,
_ charactersEscapedInAttributes: [(String, String)]
) {
let actuallyAttributes = self.elements.filter {
$0.key.isEmpty && $0.elements.isEmpty && !$0.attributes.isEmpty
Copy link
Collaborator

Choose a reason for hiding this comment

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

is key a critical check here? Maybe your original case fails because of the key value intrinsic feature described here? https://github.com/MaxDesiatov/XMLCoder#coding-key-value-intrinsic

Copy link
Collaborator

@MaxDesiatov MaxDesiatov left a comment

Choose a reason for hiding this comment

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

Would you be able to add some unit tests here? On the surface these changes do make sense if they resolve your use case. But I'd like to see that use case isolated as a unit test first.

Copy link
Collaborator

@MaxDesiatov MaxDesiatov left a comment

Choose a reason for hiding this comment

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

Seems legit, thanks

@wooj2
Copy link
Contributor Author

wooj2 commented Aug 5, 2021

Seems legit, thanks

WOW you are toooo quick! haha.. I removed the ignore swift lint, and just reduced the name so that it is under 200 characters, thanks!

@MaxDesiatov MaxDesiatov merged commit 2b1253e into CoreOffice:main Aug 5, 2021
spotlightishere pushed a commit to WiiLink24/XMLCoder that referenced this pull request Aug 6, 2021
…ice#223)

Fixes an edge case with intrinsic value key encoding.
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