advent-of-code-2024

My solutions to AoC 2024
Log | Files | Refs

day-10.lisp (944B)


      1 (defpackage #:aoc-test/day-10
      2   (:use #:cl #:lisp-unit2)
      3   (:import-from #:aoc/day-10))
      4 (in-package #:aoc-test/day-10)
      5 
      6 (define-test test-day-10
      7     ()
      8   (assert= 2 (aoc:run-day 10 "...0...
      9 ...1...
     10 ...2...
     11 6543456
     12 7.....7
     13 8.....8
     14 9.....9"))
     15   (assert= 4 (aoc:run-day 10 "..90..9
     16 ...1.98
     17 ...2..7
     18 6543456
     19 765.987
     20 876....
     21 987...."))
     22   (assert= 3 (aoc:run-day 10 "10..9..
     23 2...8..
     24 3...7..
     25 4567654
     26 ...8..3
     27 ...9..2
     28 .....01"))
     29   (assert= 36 (aoc:run-day 10 "89010123
     30 78121874
     31 87430965
     32 96549874
     33 45678903
     34 32019012
     35 01329801
     36 10456732"))
     37   (assert= 3 (nth-value 1 (aoc:run-day 10 ".....0.
     38 ..4321.
     39 ..5..2.
     40 ..6543.
     41 ..7..4.
     42 ..8765.
     43 ..9....")))
     44   (assert= 13 (nth-value 1 (aoc:run-day 10 "..90..9
     45 ...1.98
     46 ...2..7
     47 6543456
     48 765.987
     49 876....
     50 987....")))
     51   (assert= 227 (nth-value 1 (aoc:run-day 10 "012345
     52 123456
     53 234567
     54 345678
     55 4.6789
     56 56789.")))
     57   (assert= 81 (nth-value 1 (aoc:run-day 10 "89010123
     58 78121874
     59 87430965
     60 96549874
     61 45678903
     62 32019012
     63 01329801
     64 10456732"))))