twitter / util

Wonderful reusable code from Twitter
https://twitter.github.io/util
Apache License 2.0
2.69k stars 581 forks source link

util-core: improve test coverage for StorageUnit #267

Closed muachilin closed 4 years ago

muachilin commented 4 years ago

Problem

Currently the test coverage of StorageUnit still has space for improvements.

Solution

Add more assertions to test StorageUnit.

Result

Improve the test coverage of StorageUnit.

claassistantio commented 4 years ago

CLA assistant check
All committers have signed the CLA.

caniszczyk commented 4 years ago

Codecov Report

Merging #267 into develop will increase coverage by 0.01%. The diff coverage is n/a.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop     #267      +/-   ##
===========================================
+ Coverage    45.94%   45.96%   +0.01%     
===========================================
  Files          228      228              
  Lines        14447    14447              
  Branches       893      884       -9     
===========================================
+ Hits          6638     6640       +2     
+ Misses        7809     7807       -2     
Impacted Files Coverage Δ
util-core/src/main/scala/com/twitter/io/Buf.scala 91.75% <0.00%> (-0.42%) :arrow_down:
...core/src/main/scala/com/twitter/util/Promise.scala 77.91% <0.00%> (-0.41%) :arrow_down:
.../src/main/scala/com/twitter/util/StorageUnit.scala 94.82% <0.00%> (+8.62%) :arrow_up:

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 f768feb...4a61c2e. Read the comment docs.

codecov-io commented 4 years ago

Codecov Report

Merging #267 into develop will increase coverage by 0.03%. The diff coverage is n/a.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop     #267      +/-   ##
===========================================
+ Coverage    45.94%   45.98%   +0.03%     
===========================================
  Files          228      228              
  Lines        14447    14447              
  Branches       893      884       -9     
===========================================
+ Hits          6638     6643       +5     
+ Misses        7809     7804       -5
Impacted Files Coverage Δ
util-core/src/main/scala/com/twitter/io/Buf.scala 92.16% <0%> (ø) :arrow_up:
.../src/main/scala/com/twitter/util/StorageUnit.scala 94.82% <0%> (+8.62%) :arrow_up:

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 f768feb...4a61c2e. Read the comment docs.

enbnt commented 4 years ago

Thank you @muachilin! This is merged.