tests/testthat/test-myRounding.R

context("Rounding")


# my.floor(scr.vector)
test_that("my.floor", {
  expect_equal(my.floor(seq(0, 1, 0.1)), c(rep(0, 10), 1))
})

# ny.ceiling(scr.vector)
test_that("my.ceiling", {
  expect_equal(my.ceiling(seq(0, 1, 0.1)), c(0, rep(1, 10)))
})

# my.round(scr.vector)
test_that("my.round", {
  expect_equal(my.round(seq(-5, 5, 0.1), digits = 0), round(seq(-5, 5, 0.1), digits = 0))
})
vanNijnatten/Learn-Statistics documentation built on Dec. 23, 2021, 2:09 p.m.