From: Ummon Date: Fri, 8 Dec 2017 07:24:37 +0000 (+0100) Subject: Add a test case for day 7 X-Git-Url: https://git.euphorik.ch/?a=commitdiff_plain;h=b59748e0672d23e04d3111c052f37b26a56211d3;p=advent_of_code_2017.git Add a test case for day 7 --- 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