tests/testthat/test-hijack.R

context("Checking hijack")

test_that("hijack is replacing hijacks",{

    mean2 <- function(x, na.rm = FALSE, ...){
        mean(x, ..., na.rm = na.rm)
    }
    expect_true(is.na((mean2(c(NA, 1:10)))))
    mean3 <- qdapRegex:::hijack(mean2, na.rm=TRUE)
    expect_false(is.na((mean3(c(NA, 1:10)))))
    
})

Try the qdapRegex package in your browser

Any scripts or data that you put into this service are public.

qdapRegex documentation built on Oct. 17, 2023, 5:06 p.m.