tests/testthat/test-check-license.R

skip_on_cran ()

test_that ("check license", {

    checks <- make_check_data ()

    ci_out <- output_pkgchk_license (checks)

    expect_true (ci_out$check_pass)
    expect_length (ci_out$summary, 1L)
    expect_false (nzchar (ci_out$summary))
    expect_length (ci_out$print, 1L)
    expect_false (nzchar (ci_out$print))

    checks$checks$license <- "nope"
    ci_out <- output_pkgchk_license (checks)
    expect_false (ci_out$check_pass)
    expect_equal (
        ci_out$summary,
        "Package contains unacceptable 'License' entries: [nope]"
    )
})

Try the pkgcheck package in your browser

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

pkgcheck documentation built on Oct. 13, 2026, 5:06 p.m.