CoreOffice / XMLCoder

Easy XML parsing using Codable protocols in Swift
https://coreoffice.github.io/XMLCoder/
MIT License
801 stars 112 forks source link

Fixed a bug when decoding a key with one character only #96

Closed flowbe closed 5 years ago

flowbe commented 5 years ago

I found an issue with the convertFromCapitalized key decoding strategy which threw an error when the key had just one characted. This PR should fix the issue.

codecov[bot] commented 5 years ago

Codecov Report

Merging #96 into master will decrease coverage by 0.01%. The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #96      +/-   ##
==========================================
- Coverage   77.05%   77.04%   -0.02%     
==========================================
  Files          38       38              
  Lines        2114     2113       -1     
==========================================
- Hits         1629     1628       -1     
  Misses        485      485
Impacted Files Coverage Δ
Sources/XMLCoder/Decoder/XMLDecoder.swift 82.73% <100%> (-0.13%) :arrow_down:

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 0732b82...538a545. Read the comment docs.

MaxDesiatov commented 5 years ago

Thank you @TheFlow95, great catch! I've also added a test that reproduces the issue.