Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions r/tests/testthat/test-compute-arith.R
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,6 @@ test_that("Division", {
expect_equal(a / 2 / 2, Array$create(c(1:4 / 2 / 2, NA_real_)))
expect_equal(a %/% 2L %/% 2L, Array$create(c(0L, 0L, 0L, 1L, NA_integer_)))
expect_equal(a / 0, Array$create(c(Inf, Inf, Inf, Inf, NA_real_)))
# TODO add tests for integer division %/% by 0
# see https://issues.apache.org/jira/browse/ARROW-14297
Comment on lines -74 to -75
Copy link
Member

Choose a reason for hiding this comment

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

I wouldn't mind also having a test here as well as the dplyr tests. Or alternatively: maybe we mention that the %/% tests are in the dplyr math file?

Copy link
Member Author

Choose a reason for hiding this comment

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

Oh actually, I believe they are already being tested above:

...
  expect_equal(a %/% 0, Array$create(c(Inf, Inf, Inf, Inf, NA_real_)))
...
  expect_equal(a %/% 0L, Array$create(rep(NA_integer_, 5)))
...
  expect_equal(b %/% 0, Array$create(c(Inf, Inf, Inf, Inf, NA_real_)))
  expect_equal(b %/% 0L, Array$create(c(Inf, Inf, Inf, Inf, NA_real_)))
...

2468992 also added the zero tests into here. Let me fix the PR description!


b <- a$cast(float64())
expect_equal(b / 2, Array$create(c(1:4 / 2, NA_real_)))
Expand All @@ -81,8 +79,6 @@ test_that("Division", {
expect_equal(b %/% 2, Array$create(c(0, 1, 1, 2, NA_real_)))
expect_equal(b %/% 2L, Array$create(c(0, 1, 1, 2, NA_real_)))
expect_equal(b / 0, Array$create(c(Inf, Inf, Inf, Inf, NA_real_)))
# TODO add tests for integer division %/% by 0
# see https://issues.apache.org/jira/browse/ARROW-14297

# the behavior of %/% matches R's (i.e. the integer of the quotient, not
# simply dividing two integers)
Expand Down
Loading