Skip to content

Commit 74de244

Browse files
committed
Use typed NA_complex_ in test
To be agnostic to this new R-devel change wch/r-source@81b3036
1 parent 18fe71f commit 74de244

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

tests/testthat/test-deprec-combine.R

+6-6
Original file line numberDiff line numberDiff line change
@@ -180,26 +180,26 @@ test_that("combine works with NA and complex (#2203)", {
180180
withr::local_options(lifecycle_verbosity = "quiet")
181181

182182
# NA first
183-
expected_result <- c(NA, 1 + 2i)
184-
works1 <- combine(list(NA, 1 + 2i))
183+
expected_result <- c(NA_complex_, 1 + 2i)
184+
works1 <- combine(list(NA_complex_, 1 + 2i))
185185
expect_equal(works1, expected_result)
186186

187187
# NA length == 1
188-
expected_result <- c(1 + 1i, 2 + 1i, NA, 4 + 1i)
188+
expected_result <- c(1 + 1i, 2 + 1i, NA_complex_, 4 + 1i)
189189

190190
expect_equal(combine(as.list(expected_result)), expected_result)
191191

192-
works2 <- combine(list(1 + 1i, 2 + 1i, NA, 4 + 1i))
192+
works2 <- combine(list(1 + 1i, 2 + 1i, NA_complex_, 4 + 1i))
193193
expect_equal(works2, expected_result)
194194

195195
# NA length > 1
196-
expected_result <- c(1 + 1i, 2 + 1i, NA, NA, 4 + 1i)
196+
expected_result <- c(1 + 1i, 2 + 1i, NA_complex_, NA_complex_, 4 + 1i)
197197
expect_equal(
198198
combine(split(expected_result, c(1, 2, 3, 3, 4))),
199199
expected_result
200200
)
201201

202-
works3 <- combine(list(1 + 1i, 2 + 1i, c(NA, NA), 4 + 1i))
202+
works3 <- combine(list(1 + 1i, 2 + 1i, c(NA_complex_, NA_complex_), 4 + 1i))
203203
expect_equal(works3, expected_result)
204204
})
205205

0 commit comments

Comments
 (0)