mirror of
https://github.com/Smaug123/AdventOfCode2022
synced 2025-10-13 13:28:43 +00:00
Day 8 (#9)
This commit is contained in:
36
AdventOfCode2022.Test/Day8.fs
Normal file
36
AdventOfCode2022.Test/Day8.fs
Normal file
@@ -0,0 +1,36 @@
|
||||
namespace AdventOfCode2022.Test
|
||||
|
||||
open System
|
||||
open NUnit.Framework
|
||||
open FsUnitTyped
|
||||
open AdventOfCode2022
|
||||
|
||||
[<TestFixture>]
|
||||
module TestDay8 =
|
||||
|
||||
let input =
|
||||
"""30373
|
||||
25512
|
||||
65332
|
||||
33549
|
||||
35390
|
||||
"""
|
||||
|
||||
[<Test>]
|
||||
let ``Part 1, given`` () =
|
||||
Day8.part1 (StringSplitEnumerator.make '\n' input) |> shouldEqual 21
|
||||
|
||||
[<Test>]
|
||||
let ``Part 1`` () =
|
||||
let input = Assembly.readResource "Day8.txt"
|
||||
|
||||
Day8.part1 (StringSplitEnumerator.make '\n' input) |> shouldEqual 1823
|
||||
|
||||
[<Test>]
|
||||
let ``Part 2, given`` () =
|
||||
Day8.part2 (StringSplitEnumerator.make '\n' input) |> shouldEqual 8
|
||||
|
||||
[<Test>]
|
||||
let ``Part 2`` () =
|
||||
let input = Assembly.readResource "Day8.txt"
|
||||
Day8.part2 (StringSplitEnumerator.make '\n' input) |> shouldEqual 211680
|
Reference in New Issue
Block a user