tests/testthat/test-my_lm.R

# within test-my_lm.R
sample <- mtcars

test_that("my_lm works mathematically", {
  expect_equal(my_lm(mpg ~ hp, data = sample)[1, 1], 30.09886, tolerance = 1e-05)
})
cpr126/mypackage documentation built on Dec. 19, 2021, 6:08 p.m.