Day 6 and standalone app (#7)

This commit is contained in:
Patrick Stevens
2022-12-06 08:25:16 +00:00
committed by GitHub
parent 0a498ac7d4
commit ef903b33a9
18 changed files with 288 additions and 99 deletions

View File

@@ -1,6 +1,5 @@
namespace AdventOfCode2022.Test
open System
open AdventOfCode2022
open NUnit.Framework
open FsUnitTyped
@@ -28,18 +27,18 @@ module TestDay1 =
[<Test>]
let ``Part 1`` () =
let input = Assembly.readResource "Day1.txt"
input.Split '\n' |> Day1.part1 |> shouldEqual 66306
Day1.part1 (StringSplitEnumerator.make '\n' input) |> shouldEqual 66306
[<Test>]
let ``Part 2`` () =
let input = Assembly.readResource "Day1.txt"
input.Split '\n' |> Day1.part2 |> shouldEqual 195292
Day1.part2 (StringSplitEnumerator.make '\n' input) |> shouldEqual 195292
[<Test>]
let ``Part 1, given example`` () =
testInput.Split Environment.NewLine |> Day1.part1 |> shouldEqual 24000
Day1.part1 (StringSplitEnumerator.make '\n' testInput) |> shouldEqual 24000
[<Test>]
let ``Part 2, given example`` () =
testInput.Split Environment.NewLine |> Day1.part2 |> shouldEqual 45000
Day1.part2 (StringSplitEnumerator.make '\n' testInput) |> shouldEqual 45000