This commit is contained in:
Patrick Stevens
2022-12-12 13:02:30 +00:00
committed by GitHub
parent 65cc8ac65a
commit a2cc226bb2
16 changed files with 442 additions and 33 deletions

View 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