tests/testthat/test-day02.R

test_that("day 2", {
  expect_equal(compute(c(1,9,10,3,2,3,11,0,99,30,40,50)),
               c(3500,9,10,70,
               2,3,11,0,
               99,
               30,40,50))
  expect_equal(compute(c(1,0,0,0,99)),
               c(2,0,0,0,99))
  expect_equal(compute(c(2,3,0,3,99)),
               c(2,3,0,6,99))
  expect_equal(compute(c(2,4,4,5,99,0)),
               c(2,4,4,5,99,9801))
  expect_equal(compute(c(1,1,1,4,99,5,6,0,99)),
               c(30,1,1,4,2,5,6,0,99))
})
Selbosh/adventofcode2019 documentation built on Dec. 18, 2021, 1:03 p.m.