mrc-ide / individual

R Package for individual based epidemiological models
https://mrc-ide.github.io/individual
Other
30 stars 16 forks source link

Add an all.equal implementation for Bitset. #192

Closed plietar closed 8 months ago

plietar commented 8 months ago

Calling all.equal (or equivalently expect_equal) on bitsets has never worked correctly. For some reason, externalptr always compare as equal, thus, under the R6 implementation, any bitset with the same max size was treated as equal.

With the recent switch to a named list and bitsets would sometimes be considered different, even where their contents were the same. More precisely, the arguments of Bitset$new now happen to be captured by all of the methods' environments and were being included in the comparison. A bitset created with new(size=N) would always be different compared to a bitset created with new(from=ptr).

malariasimulation has some tests that use mockery::expect_args to compare bitset arguments, and these tests are now broken by the new individual version.

codecov[bot] commented 8 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 96.13%. Comparing base (c9cdee3) to head (b99d893). Report is 21 commits behind head on dev.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## dev #192 +/- ## ========================================== - Coverage 96.28% 96.13% -0.15% ========================================== Files 36 36 Lines 1722 1839 +117 ========================================== + Hits 1658 1768 +110 - Misses 64 71 +7 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.