tests/testthat/test-logging.R

##### TESTS #####

test_that("logging works", {

    expect_true({
        log_info("the stuff")
        TRUE
    })

    expect_warning({
        log_warn("some stuff")
    }, regexp = "some stuff")

    expect_error({
        log_fatal("other stuff")
    }, regexp = "other stuff")

})

Try the pkgnet package in your browser

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

pkgnet documentation built on June 22, 2024, 12:19 p.m.