Skip to content

Commit

Permalink
GH-44674: [R] Fix R CMD check failure with dev testthat (#44675)
Browse files Browse the repository at this point in the history
### Rationale for this change

Update assertion code in some of the R tests to be compatible with the in-development version of testthat.

### What changes are included in this PR?

Updated assertions in tests.

### Are these changes tested?

Yes.

### Are there any user-facing changes?

No.

Fixes #44674.
* GitHub Issue: #44674

Authored-by: Bryce Mecum <[email protected]>
Signed-off-by: Bryce Mecum <[email protected]>
  • Loading branch information
amoeba committed Nov 11, 2024
1 parent abd021c commit d20173f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions r/tests/testthat/test-Array.R
Original file line number Diff line number Diff line change
Expand Up @@ -1261,15 +1261,15 @@ test_that("concat_arrays works", {

concat_int <- concat_arrays(arrow_array(1:3), arrow_array(4:5))
expect_true(concat_int$type == int32())
expect_true(all(concat_int == arrow_array(1:5)))
expect_equal(concat_int, arrow_array(1:5))

concat_int64 <- concat_arrays(
arrow_array(1:3),
arrow_array(4:5, type = int64()),
type = int64()
)
expect_true(concat_int64$type == int64())
expect_true(all(concat_int == arrow_array(1:5)))
expect_equal(concat_int, arrow_array(1:5))

expect_error(
concat_arrays(
Expand All @@ -1283,7 +1283,7 @@ test_that("concat_arrays works", {
test_that("concat_arrays() coerces its input to Array", {
concat_ints <- concat_arrays(1L, 2L)
expect_true(concat_ints$type == int32())
expect_true(all(concat_ints == arrow_array(c(1L, 2L))))
expect_equal(concat_ints, arrow_array(c(1L, 2L)))

expect_error(
concat_arrays(1L, "not a number", type = int32()),
Expand Down
2 changes: 1 addition & 1 deletion r/tests/testthat/test-extension.R
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ test_that("extension types can be created", {
expect_r6_class(array$type, "ExtensionType")

expect_true(array$type == type)
expect_true(all(array$storage() == storage))
expect_equal(array$storage(), storage)

expect_identical(array$as_vector(), 1:10)
expect_identical(chunked_array(array)$as_vector(), 1:10)
Expand Down
2 changes: 1 addition & 1 deletion r/tests/testthat/test-parquet.R
Original file line number Diff line number Diff line change
Expand Up @@ -455,7 +455,7 @@ test_that("deprecated int96 timestamp unit can be specified when reading Parquet
)

expect_identical(result$some_datetime$type$unit(), TimeUnit$MILLI)
expect_true(result$some_datetime == table$some_datetime)
expect_equal(result$some_datetime, table$some_datetime$cast(result$some_datetime$type))
})

test_that("Can read parquet with nested lists and maps", {
Expand Down

0 comments on commit d20173f

Please sign in to comment.