Files
advent-of-code-2023/AdventOfCode2023.FSharp/Test/TestDay14.fs
patrick 9ec99c8ee9
All checks were successful
ci/woodpecker/push/build Pipeline was successful
ci/woodpecker/push/all-checks-complete Pipeline was successful
Day 14 (#16)
Co-authored-by: Smaug123 <patrick+github@patrickstevens.co.uk>
Reviewed-on: #16
2023-12-14 18:11:14 +00:00

49 lines
1.2 KiB
Forth

namespace AdventOfCode2023.Test
open System
open AdventOfCode2023
open NUnit.Framework
open FsUnitTyped
open System.IO
[<TestFixture>]
module TestDay14 =
[<Test>]
let sample = Assembly.getEmbeddedResource typeof<Dummy>.Assembly "day14.txt"
[<Test>]
let part1Sample () =
sample |> Day14.part1 |> shouldEqual 136ul
[<Test>]
let part2Sample () =
sample |> Day14.part2 |> shouldEqual 64ul
[<Test>]
let part1Actual () =
let s =
try
File.ReadAllText (Path.Combine (__SOURCE_DIRECTORY__, "../../inputs/day14.txt"))
with
| :? DirectoryNotFoundException
| :? FileNotFoundException ->
Assert.Inconclusive ()
failwith "unreachable"
Day14.part1 s |> shouldEqual 111339ul
[<Test>]
let part2Actual () =
let s =
try
File.ReadAllText (Path.Combine (__SOURCE_DIRECTORY__, "../../inputs/day14.txt"))
with
| :? DirectoryNotFoundException
| :? FileNotFoundException ->
Assert.Inconclusive ()
failwith "unreachable"
Day14.part2 s |> shouldEqual 93736ul