tests/testthat/test-my_pow.R

test_that("multiplication works", {
  expect_equal(2 * 2, 4)
})

test_that("my_pow works mathematically", {
  expect_equal(my_pow(2), 4)
  expect_equal(my_pow(2, power = 3), 8)
})

test_that("non-numeric input throws error", {
  expect_error(my_pow("A string"))
  expect_error(my_pow(2, power = "A string"))
})
oliverlinehan41/project3package documentation built on Dec. 22, 2021, 4:21 a.m.