Skip to content

Commit

Permalink
basic tests of match()
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelChirico committed Oct 8, 2024
1 parent fd01f08 commit 7d43421
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions tests/testthat/test-highlevel64.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
test_that("match basics work", {
x = as.integer64(2:5)
y = as.integer64(3:6)
expect_identical(match(x, y), c(NA, 1:3))
expect_identical(match(y, x), c(2:4, NA))

expect_identical(match(2:5, y), c(NA, 1:3))
expect_identical(match(as.numeric(2:5), y), c(NA, 1:3))
expect_identical(match(y, 2:5), c(2:4, NA))
expect_identical(match(y, as.numeric(2:5)), c(2:4, NA))

expect_identical(match(x, y, nomatch=0L), 0:3)
})

0 comments on commit 7d43421

Please sign in to comment.