cqframework / cql-execution

A JavaScript framework for executing CQL
Apache License 2.0
65 stars 30 forks source link

ToQuantity: Fix Decimal/Integer Overloads & add Ratio Overload #235

Closed cmoesel closed 3 years ago

cmoesel commented 3 years ago

This PR contains fixes and enhancements to ToQuantity:

Fixes #175

Submitter:

Reviewer:

Name:

codecov-io commented 3 years ago

Codecov Report

Merging #235 (f7b90f2) into master (ebaf5f9) will decrease coverage by 0.01%. The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #235      +/-   ##
==========================================
- Coverage   92.27%   92.26%   -0.02%     
==========================================
  Files          47       47              
  Lines        3975     3981       +6     
==========================================
+ Hits         3668     3673       +5     
- Misses        307      308       +1     
Impacted Files Coverage Δ
src/elm/type.js 87.90% <100.00%> (+0.26%) :arrow_up:
src/datatypes/quantity.js 87.50% <0.00%> (-1.05%) :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 ebaf5f9...f7b90f2. Read the comment docs.

cmoesel commented 3 years ago

I was a bit perplexed how coverage went down, particularly in a file I did not modify. But it is because we used to call parseQuantity for all cases, which is clearly not the right thing to do. One of those cases (for numbers) set the units to '' in quantity.js -- but since that's not the behavior we want, we don't call that function that way anymore, so that line that sets units to '' is no longer covered. Honestly... I'm not worried about it -- but let me know if you are.