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

45 lines
1.2 KiB
Forth

namespace AdventOfCode2023.Test
open AdventOfCode2023
open NUnit.Framework
open FsUnitTyped
open System.IO
[<TestFixture>]
module TestDay16 =
[<Test>]
let sample = Assembly.getEmbeddedResource typeof<Dummy>.Assembly "day16.txt"
[<Test>]
let part1Sample () = sample |> Day16.part1 |> shouldEqual 46
[<Test>]
let part2Sample () = sample |> Day16.part2 |> shouldEqual 51
[<Test>]
let part1Actual () =
let s =
try
File.ReadAllText (Path.Combine (__SOURCE_DIRECTORY__, "../../inputs/day16.txt"))
with
| :? DirectoryNotFoundException
| :? FileNotFoundException ->
Assert.Inconclusive ()
failwith "unreachable"
Day16.part1 s |> shouldEqual 8112
[<Test>]
let part2Actual () =
let s =
try
File.ReadAllText (Path.Combine (__SOURCE_DIRECTORY__, "../../inputs/day16.txt"))
with
| :? DirectoryNotFoundException
| :? FileNotFoundException ->
Assert.Inconclusive ()
failwith "unreachable"
Day16.part2 s |> shouldEqual 8314