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

add some test cases for util package #70

Merged
merged 3 commits into from
Apr 12, 2021
Merged

add some test cases for util package #70

merged 3 commits into from
Apr 12, 2021

Conversation

javeme
Copy link
Contributor

@javeme javeme commented Apr 7, 2021

Change-Id: I39b457c2a7a338a909b3aa0ba8ff4a8b5057b339

Change-Id: I39b457c2a7a338a909b3aa0ba8ff4a8b5057b339
@javeme
Copy link
Contributor Author

javeme commented Apr 7, 2021

Before adding test cases:
image

@codecov
Copy link

codecov bot commented Apr 7, 2021

Codecov Report

Merging #70 (9da2894) into master (265f74b) will increase coverage by 2.53%.
The diff coverage is 90.90%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master      #70      +/-   ##
============================================
+ Coverage     85.08%   87.61%   +2.53%     
- Complexity      793      829      +36     
============================================
  Files            61       61              
  Lines          2299     2326      +27     
  Branches        341      352      +11     
============================================
+ Hits           1956     2038      +82     
+ Misses          192      147      -45     
+ Partials        151      141      -10     
Impacted Files Coverage Δ Complexity Δ
...ain/java/com/baidu/hugegraph/util/NumericUtil.java 90.51% <80.00%> (+6.91%) 82.00 <13.00> (+14.00)
...ain/java/com/baidu/hugegraph/util/VersionUtil.java 83.72% <90.47%> (+24.26%) 10.00 <1.00> (+1.00)
.../java/com/baidu/hugegraph/util/CollectionUtil.java 98.11% <100.00%> (+13.57%) 42.00 <7.00> (+11.00)
...c/main/java/com/baidu/hugegraph/util/DateUtil.java 86.36% <100.00%> (+10.36%) 9.00 <0.00> (ø)
.../main/java/com/baidu/hugegraph/event/EventHub.java 81.94% <0.00%> (+1.38%) 27.00% <0.00%> (+1.00%)
...n/java/com/baidu/hugegraph/concurrent/KeyLock.java 80.39% <0.00%> (+1.96%) 26.00% <0.00%> (+1.00%)
.../main/java/com/baidu/hugegraph/perf/Stopwatch.java 87.75% <0.00%> (+2.04%) 21.00% <0.00%> (+1.00%)
...main/java/com/baidu/hugegraph/util/StringUtil.java 93.75% <0.00%> (+10.41%) 6.00% <0.00%> (ø%)
... and 4 more

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 265f74b...9da2894. Read the comment docs.

@javeme
Copy link
Contributor Author

javeme commented Apr 7, 2021

After adding test cases:
image

List<T> list = new ArrayList<>(original);
if (to == -1) {
if (from < 0) {
E.checkArgument(from >= 0,
Copy link
Contributor

Choose a reason for hiding this comment

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

if seems unnecessary, consider for perf? If so, add a comment

Copy link
Contributor Author

Choose a reason for hiding this comment

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

to keep same style with "if (to < 0)"

Change-Id: Id95c4e2e5b9f4453d57750470fc54d58ec6531d9
corgiboygsj
corgiboygsj previously approved these changes Apr 12, 2021
if (to == -1) {
E.checkArgument(from >= 0,
"Invalid from parameter of subSet(): %s", from);
if (to < 0) {
Copy link
Contributor

Choose a reason for hiding this comment

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

"if (to < 0)" => "if (to < from)". IllegalArgumentException will be thrown if to < from。

Change-Id: I32d83f5738250eca23ae16c2ccbf52059a874bf6
@Linary Linary merged commit d51efb6 into master Apr 12, 2021
@Linary Linary deleted the add-test-cases branch April 12, 2021 08:28
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.

4 participants