diff --git a/tests/testthat/test-highlevel64.R b/tests/testthat/test-highlevel64.R new file mode 100644 index 0000000..286e971 --- /dev/null +++ b/tests/testthat/test-highlevel64.R @@ -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) +})