Bones
This commit is contained in:
@@ -24,6 +24,7 @@
|
||||
<Compile Include="TestDay13.fs" />
|
||||
<Compile Include="TestDay14.fs" />
|
||||
<Compile Include="TestDay15.fs" />
|
||||
<Compile Include="TestDay16.fs" />
|
||||
<EmbeddedResource Include="samples\day1.txt"/>
|
||||
<EmbeddedResource Include="samples\day1part1.txt"/>
|
||||
<EmbeddedResource Include="samples\day2.txt"/>
|
||||
@@ -42,6 +43,7 @@
|
||||
<EmbeddedResource Include="samples\day13.txt" />
|
||||
<EmbeddedResource Include="samples\day14.txt" />
|
||||
<EmbeddedResource Include="samples\day15.txt" />
|
||||
<EmbeddedResource Include="samples\day16.txt" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
46
AdventOfCode2023.FSharp/Test/TestDay16.fs
Normal file
46
AdventOfCode2023.FSharp/Test/TestDay16.fs
Normal file
@@ -0,0 +1,46 @@
|
||||
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 1320
|
||||
|
||||
[<Test>]
|
||||
let part2Sample () =
|
||||
sample |> Day16.part2 |> shouldEqual 145ul
|
||||
|
||||
[<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 521434
|
||||
|
||||
[<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 248279ul
|
||||
0
AdventOfCode2023.FSharp/Test/samples/day16.txt
Normal file
0
AdventOfCode2023.FSharp/Test/samples/day16.txt
Normal file
Reference in New Issue
Block a user