Skip to content

Commit

Permalink
Fixing a test issue that offsets loc2idx by one (0-based)
Browse files Browse the repository at this point in the history
  • Loading branch information
dipterix committed Nov 8, 2024
1 parent 0ec1f38 commit ab9e994
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion tests/testthat/test-cpp.R
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,10 @@ test_that("C++: Utils", {
})
re1 <- x[locs[[1]], locs[[2]], locs[[3]]]
locs <- lapply(locs, as_int64)
expect_equal(loc2idx(locs, dim), as_int64(re1))

v1 <- loc2idx(locs, dim)
v2 <- as_int64(re1 - 1L)
expect_identical(v1, v2)

})

Expand Down

0 comments on commit ab9e994

Please sign in to comment.