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

Improve code coverage of auxiliary types #43

Merged
merged 5 commits into from
Dec 24, 2018
Merged

Improve code coverage of auxiliary types #43

merged 5 commits into from
Dec 24, 2018

Conversation

regexident
Copy link
Contributor

No description provided.

@codecov
Copy link

codecov bot commented Dec 24, 2018

Codecov Report

Merging #43 into master will increase coverage by 1.19%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master     #43      +/-   ##
=========================================
+ Coverage    54.2%   55.4%   +1.19%     
=========================================
  Files          29      29              
  Lines        1402    1397       -5     
=========================================
+ Hits          760     774      +14     
+ Misses        642     623      -19
Impacted Files Coverage Δ
Sources/XMLCoder/Auxiliaries/XMLKey.swift 100% <100%> (+75%) ⬆️
Sources/XMLCoder/Auxiliaries/XMLHeader.swift 100% <100%> (+9.09%) ⬆️
Sources/XMLCoder/Auxiliaries/XMLElement.swift 93.16% <100%> (+6.17%) ⬆️

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 68f9c8f...e568385. Read the comment docs.

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.

I'm a bit worried about new uniqueKeysWithValues Dictionary initialiser which I think changes behaviour of overlapping keys in keyed containers. Could you please clarify if this is a desired behaviour and add test coverage for the behaviour you'd like to settle with? Thanks.

elements = Dictionary(elementsByKey) { existingElements, newElements in
existingElements + newElements
}
elements = Dictionary(uniqueKeysWithValues: elementsByKey)
Copy link
Collaborator

Choose a reason for hiding this comment

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

from what I see this new code has a different meaning: values with matching keys will be overwritten with new values, while in the old version these values are merged. Is this something we'd definitely like to do?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The keys are retrieved from another KeyedBox via box.elements.map { key, box in … }.
No additional keys are being introduced. As such the keys remain unique. :)

@MaxDesiatov MaxDesiatov merged commit fec4900 into CoreOffice:master Dec 24, 2018
@regexident regexident deleted the fix/code-coverage-auxiliaries branch December 24, 2018 21:38
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