mirror of
https://github.com/Smaug123/AdventOfCode2022
synced 2025-10-06 10:08:42 +00:00
Day 12 (#19)
This commit is contained in:
36
AdventOfCode2022.Test/Day12.fs
Normal file
36
AdventOfCode2022.Test/Day12.fs
Normal file
@@ -0,0 +1,36 @@
|
||||
namespace AdventOfCode2022.Test
|
||||
|
||||
open NUnit.Framework
|
||||
open FsUnitTyped
|
||||
open AdventOfCode2022
|
||||
|
||||
[<TestFixture>]
|
||||
module TestDay12 =
|
||||
|
||||
let input =
|
||||
"""Sabqponm
|
||||
abcryxxl
|
||||
accszExk
|
||||
acctuvwj
|
||||
abdefghi
|
||||
"""
|
||||
|
||||
[<Test>]
|
||||
let ``Part 1, given`` () =
|
||||
Day12.part1 (StringSplitEnumerator.make '\n' input) |> shouldEqual 31
|
||||
|
||||
[<Test>]
|
||||
let ``Part 1`` () =
|
||||
let input = Assembly.readResource "Day12.txt"
|
||||
|
||||
Day12.part1 (StringSplitEnumerator.make '\n' input) |> shouldEqual 456
|
||||
|
||||
|
||||
[<Test>]
|
||||
let ``Part 2, given`` () =
|
||||
Day12.part2 (StringSplitEnumerator.make '\n' input) |> shouldEqual 29
|
||||
|
||||
[<Test>]
|
||||
let ``Part 2`` () =
|
||||
let input = Assembly.readResource "Day12.txt"
|
||||
Day12.part2 (StringSplitEnumerator.make '\n' input) |> shouldEqual 454
|
Reference in New Issue
Block a user