Skip to content

Commit

Permalink
2024: Introduce FsUnit
Browse files Browse the repository at this point in the history
  • Loading branch information
jp7677 committed Nov 15, 2024
1 parent d81b0c9 commit ea01520
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions 2024/aoc2024.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="FsUnit.xUnit" Version="6.0.1" />
</ItemGroup>

<ItemGroup>
Expand Down
8 changes: 4 additions & 4 deletions 2024/src/Day00.fs
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
namespace aoc2024

open Xunit
open FsUnit.Xunit
open Util

module Day00 =

[<Fact>]
let ``Part 01`` () =
let lines = Util.ReadInput("day00-input.txt")
let first = lines |> Seq.head |> int
Assert.Equal(0, first)
let ``part 01``() =
input "day00-input.txt" |> Seq.head |> int |> should equal 0
2 changes: 1 addition & 1 deletion 2024/src/Util.fs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ open System

module Util =

let ReadInput(name: string) =
let input(name: string) =
let path = $"{Reflection.Assembly.GetExecutingAssembly().Location}/../../../../data/{name}"
seq { yield! IO.File.ReadLines path }

0 comments on commit ea01520

Please sign in to comment.