tests/testthat/test-set_seed.R

#' Copyright(c) 2017-2024 R. Mark Sharp
#' This file is part of nprcgenekeepr
context("set_seed")

test_that("set_seed handle R versions < 3.6", {
  local_mocked_bindings(
    R_version = function() {
      list(major = "4", minor = "4.2")
    }
  )
  newSeed <- set_seed(1L)
  local_mocked_bindings(
    R_version = function() {
      list(major = "3", minor = "5.3")
    }
  )
  oldSeed <- set_seed(1L)

  expect_identical(newSeed, oldSeed)
})

Try the nprcgenekeepr package in your browser

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

nprcgenekeepr documentation built on June 8, 2025, 10:55 a.m.