mirror of
https://github.com/Smaug123/AdventOfCode2022
synced 2025-10-11 12:38:41 +00:00
Day 22 and speedups (#34)
This commit is contained in:
46
AdventOfCode2022.Test/Day22.fs
Normal file
46
AdventOfCode2022.Test/Day22.fs
Normal file
@@ -0,0 +1,46 @@
|
||||
namespace AdventOfCode2022.Test
|
||||
|
||||
open NUnit.Framework
|
||||
open FsUnitTyped
|
||||
open AdventOfCode2022
|
||||
|
||||
[<TestFixture>]
|
||||
module TestDay22 =
|
||||
|
||||
let input =
|
||||
""" ...#
|
||||
.#..
|
||||
#...
|
||||
....
|
||||
...#.......#
|
||||
........#...
|
||||
..#....#....
|
||||
..........#.
|
||||
...#....
|
||||
.....#..
|
||||
.#......
|
||||
......#.
|
||||
|
||||
10R5L5R10L4R5L5
|
||||
"""
|
||||
|
||||
[<Test>]
|
||||
let ``Part 1, given`` () =
|
||||
Day22.part1 (StringSplitEnumerator.make '\n' input) |> shouldEqual 6032
|
||||
|
||||
[<Test>]
|
||||
let ``Part 1`` () =
|
||||
let input = Assembly.readResource "Day22.txt"
|
||||
|
||||
Day22.part1 (StringSplitEnumerator.make '\n' input) |> shouldEqual 103224
|
||||
|
||||
|
||||
[<Test>]
|
||||
let ``Part 2, given`` () =
|
||||
Day22.part2Example (StringSplitEnumerator.make '\n' input) |> shouldEqual 5031
|
||||
|
||||
[<Test>]
|
||||
let ``Part 2`` () =
|
||||
let input = Assembly.readResource "Day22.txt"
|
||||
|
||||
Day22.part2 (StringSplitEnumerator.make '\n' input) |> shouldEqual 189097
|
Reference in New Issue
Block a user