tests/testthat/test-metadata.R

test_that("renv_metadata_version_friendly gives user friendly output", {

  expect_equal(
    renv_metadata_version_friendly(list(version = "1.0.0")),
    "1.0.0"
  )

  expect_equal(
    renv_metadata_version_friendly(list(version = structure("1.0.0", sha = "abcd1234"))),
    "1.0.0 [sha: abcd123]"
  )

  expect_equal(

    renv_metadata_version_friendly(
      metadata = list(version = structure("1.0.0", sha = "abcd1234")),
      shafmt = "; sha: %s"
    ),

    "1.0.0; sha: abcd123"

  )

})

Try the renv package in your browser

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

renv documentation built on Sept. 19, 2023, 9:06 a.m.