Skip to content

Commit

Permalink
add tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
t-kalinowski committed Sep 18, 2024
1 parent d2c6ffc commit d19543a
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions tests/testthat/test-python-numpy.R
Original file line number Diff line number Diff line change
Expand Up @@ -190,3 +190,15 @@ test_that("numpy non-simple arrays work", {
c(3, 4)))

})

test_that("0-length character arrays are handled correctly", {
# https://github.com/rstudio/reticulate/issues/1662
skip_if_no_numpy()
np <- import("numpy")

for (dtype in c("U", "U1", "U10", "O", "S", "S1", "S10")) {
expect_equal(np$array(character(), dtype = dtype),
array(character()))
}
})

0 comments on commit d19543a

Please sign in to comment.