From b59748e0672d23e04d3111c052f37b26a56211d3 Mon Sep 17 00:00:00 2001 From: Ummon Date: Fri, 8 Dec 2017 08:24:37 +0100 Subject: [PATCH] Add a test case for day 7 --- Tests/Day7 tests.fs | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/Tests/Day7 tests.fs b/Tests/Day7 tests.fs index 022e615..0565ab1 100644 --- a/Tests/Day7 tests.fs +++ b/Tests/Day7 tests.fs @@ -53,4 +53,26 @@ type ``Day7 tests`` (output : ITestOutputHelper) = | Some (tower, weight) -> tower.Name =! "ugml" weight =! 60 - | None -> failwith "no tower found" \ No newline at end of file + | None -> failwith "no tower found" + + [] + let ``(Part2) A balanced tree`` () = + let input = + [ + "pbga (66)" + "xhth (57)" + "ebii (61)" + "havc (66)" + "ktlj (57)" + "fwft (72) -> ktlj, cntj, xhth" + "qoyq (66)" + "padx (45) -> pbga, havc, qoyq" + "tknk (41) -> ugml, padx, fwft" + "jptl (61)" + "ugml (60) -> gyxo, ebii, jptl" + "gyxo (61)" + "cntj (57)" + ] + let tower = Day7.buildTower (Day7.parseInput input) + + Day7.findUnbalanced tower =! None \ No newline at end of file -- 2.45.2