inst/tinytest/test_lifeCycle.R

test_fun <- function() {
    lifeCycle(newfun = "new_test", package = "BiocBaseUtils")
}

expect_warning(
    test_fun(),
    "'test_fun' is deprecated\\."
)

expect_warning(
    test_fun(),
    "Use 'new_test' instead\\."
)

expect_warning(
    test_fun(),
    "See help\\('BiocBaseUtils-deprecated'\\)\\."
)

test_fun <- function() {
    lifeCycle(
        newfun = "new_test", package = "BiocBaseUtils", cycle = "defunct"
    )
}

expect_error(
    test_fun(),
    "'test_fun' is defunct\\."
)

expect_error(
    test_fun(),
    "Use 'new_test' instead\\."
)

expect_error(
    test_fun(),
    "See help\\('BiocBaseUtils-defunct'\\)\\."
)
Bioconductor/BiocDeveloper documentation built on Oct. 31, 2024, 5:50 a.m.