tests/testthat/test_metric_score_labels.R

test_that("scored assessments maintain labels which indicate what the score represents", {
  pkg_scores_objs <- list(
    # score_cran_remote_good, 
    # score_cran_remote_bad, 
    score_source_good
    # score_source_bad,
    # score_stdlib_install,
    # score_stdlibs_install,
    # score_pkg_missing
  )

  for (pkg_scores_i in pkg_scores_objs) {
    expect_true({
      scores_have_labels <- vapply(
        pkg_scores_i, 
        function(i) !is.null(attr(i, "label")),
        logical(1L))

      all(scores_have_labels)
    })
  }
})

Try the riskmetric package in your browser

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

riskmetric documentation built on Sept. 1, 2023, 1:06 a.m.