Skip to content

Commit d20173f

Browse files
committed
GH-44674: [R] Fix R CMD check failure with dev testthat (#44675)
### 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]>
1 parent abd021c commit d20173f

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

r/tests/testthat/test-Array.R

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1261,15 +1261,15 @@ test_that("concat_arrays works", {
12611261

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

12661266
concat_int64 <- concat_arrays(
12671267
arrow_array(1:3),
12681268
arrow_array(4:5, type = int64()),
12691269
type = int64()
12701270
)
12711271
expect_true(concat_int64$type == int64())
1272-
expect_true(all(concat_int == arrow_array(1:5)))
1272+
expect_equal(concat_int, arrow_array(1:5))
12731273

12741274
expect_error(
12751275
concat_arrays(
@@ -1283,7 +1283,7 @@ test_that("concat_arrays works", {
12831283
test_that("concat_arrays() coerces its input to Array", {
12841284
concat_ints <- concat_arrays(1L, 2L)
12851285
expect_true(concat_ints$type == int32())
1286-
expect_true(all(concat_ints == arrow_array(c(1L, 2L))))
1286+
expect_equal(concat_ints, arrow_array(c(1L, 2L)))
12871287

12881288
expect_error(
12891289
concat_arrays(1L, "not a number", type = int32()),

r/tests/testthat/test-extension.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ test_that("extension types can be created", {
3535
expect_r6_class(array$type, "ExtensionType")
3636

3737
expect_true(array$type == type)
38-
expect_true(all(array$storage() == storage))
38+
expect_equal(array$storage(), storage)
3939

4040
expect_identical(array$as_vector(), 1:10)
4141
expect_identical(chunked_array(array)$as_vector(), 1:10)

r/tests/testthat/test-parquet.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -455,7 +455,7 @@ test_that("deprecated int96 timestamp unit can be specified when reading Parquet
455455
)
456456

457457
expect_identical(result$some_datetime$type$unit(), TimeUnit$MILLI)
458-
expect_true(result$some_datetime == table$some_datetime)
458+
expect_equal(result$some_datetime, table$some_datetime$cast(result$some_datetime$type))
459459
})
460460

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

0 commit comments

Comments
 (0)