tests/testthat/test-day10.R

test_that("Day 10", {
  example <- '[({(<(())[]>[[{[]{<()<>>
[(()[<>])]({[<{<<[]>>(
{([(<{}[<>[]}>{[]{[(<()>
(((({<>}<{<{<>}{[]{[]{}
[[<[([]))<([[{}[[()]]]
[{[{({}]{}}([{[{{{}}([]
{<[[]]>}<{[{[{[]{()[[[]
[<(<(<(<{}))><([]([]()
<{([([[(<>()){}]>(<<{{
<{([{{}}[<[[[<>{}]]]>[]]'
  lines <- readLines(textConnection(example))
  expect_equal(syntax_score(lines), 26397)
  expect_equal(autocomplete(lines), 288957)
})
Selbosh/adventofcode2021 documentation built on Jan. 1, 2022, 7:20 p.m.