tests/testthat/test-rounding.R

test_that("round_to_nearest_digit works", {

  testthat::expect_equal(round_to_nearest_digit(0.5), 1)
  testthat::expect_equal(round_to_nearest_digit(1.5), 2)
  testthat::expect_equal(round_to_nearest_digit(-0.5), -1)
  testthat::expect_equal(round_to_nearest_digit(-1.5), -2)

})

Try the RiskScorescvd package in your browser

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

RiskScorescvd documentation built on June 27, 2024, 5:13 p.m.