tests/testthat/test-my_lm.R

# within test-my_t.test.R
test_that("my_t.test works mathematically", {
  expect_equal(my_lm(lifeExp ~ gdpPercap + continent, my_gapminder),
               summary(lm(lifeExp ~ gdpPercap + continent, my_gapminder))$coefficients,
               tolerance = 1e-10)
})
test_that("dataset does not contain the variables in the formula", {
  expect_error(my_lm(lifeExp ~ gdpPercap + continent, my_penguins))
})
mzhang98/project3 documentation built on March 22, 2021, 1:51 p.m.