sckott / mutant

mutation testing for R
https://sckott.github.io/mutant/
Other
16 stars 2 forks source link

Option 2: Fix loop that goes out of bounds #15

Closed devarops closed 4 years ago

devarops commented 4 years ago

This PR is an aternative to #14.


The i in the while loop in mutate some times gets bigger than the length of x. That is a problem in this line:

x[[i]] <- mutate_one(x[[i]])

since it produces this error:

Error in x[[i]] : subscript out of bounds
codecov-commenter commented 4 years ago

Codecov Report

Merging #15 into master will increase coverage by 0.12%. The diff coverage is 0.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #15      +/-   ##
==========================================
+ Coverage   16.15%   16.27%   +0.12%     
==========================================
  Files          12       12              
  Lines         130      129       -1     
==========================================
  Hits           21       21              
+ Misses        109      108       -1     
Impacted Files Coverage Δ
R/mutate.R 0.00% <0.00%> (ø)

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 aa011ef...4b0ca02. Read the comment docs.

devarops commented 4 years ago

This PR addresses this comment:

If i gets bigger than the length of x, then we've gone through all the elements of x.

sckott commented 4 years ago

I think we can go with option 1 in #14