This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
|
||||
|
||||
#' x <- LETTERS
|
||||
#' y <- c(letters, LETTERS)
|
||||
#' match_test(x, y)
|
||||
#'
|
||||
#'
|
||||
context("Test Basic Output for match_test")
|
||||
|
||||
test_that("pretty_per respects rounding", {
|
||||
x <- LETTERS
|
||||
y <- c(letters, LETTERS)
|
||||
testthat::expect_output(match_test(x, y))
|
||||
|
||||
})
|
||||
@@ -47,6 +47,18 @@ test_that("Function subs out NAs in numeric vectors with 0", {
|
||||
expect_equivalent(na_zero(c(1:10, NA)), c(1:10, 0))
|
||||
})
|
||||
|
||||
# Test that na_sum works
|
||||
test_that("NA Sum takes sum setting NA values to 0", {
|
||||
expect_equivalent(na_sum(c(1:10, NA)), sum(1:10, 0))
|
||||
expect_message(na_sum(c(1:10, NA)), "Taking a sum with missing values equal to 0, be careful 🐲")
|
||||
})
|
||||
|
||||
test_that("na_sum fails with non-numerics", {
|
||||
expect_error(na_sum(LETTERS))
|
||||
expect_error(na_sum(as.factor(1:10)))
|
||||
})
|
||||
|
||||
|
||||
context("Test Utilities - Pretty Count")
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user