diff --git a/tests/testthat.R b/tests/testthat.R new file mode 100644 index 0000000..2292108 --- /dev/null +++ b/tests/testthat.R @@ -0,0 +1,4 @@ +library(testthat) +library(Highlander) + +test_check("Highlander") diff --git a/tests/testthat/test-lowlander-helpers.R b/tests/testthat/test-lowlander-helpers.R new file mode 100644 index 0000000..50f4be7 --- /dev/null +++ b/tests/testthat/test-lowlander-helpers.R @@ -0,0 +1,14 @@ +test_that("Lowlander_kept ranks finite samples in the recorded direction", { + result <- list( + latin_mod = matrix(c(0, 10, 1, 11, 2, 12, 3, 13), ncol = 2, byrow = TRUE), + keep = 1:4, + output = c(4, 1, 3, 2), + liketype = "min" + ) + result$output[2] <- Inf + + expect_equal( + Lowlander_kept(result), + matrix(c(3, 13, 2, 12, 0, 10), ncol = 2, byrow = TRUE) + ) +})