You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

17 lines
613 B

3 weeks ago
  1. module Main (main) where
  2. import Test.Hspec
  3. import Day1
  4. import Day2
  5. main :: IO ()
  6. main = hspec $ do
  7. describe "Day1" $ do
  8. it "solves part 1" $ do
  9. Day1.part1 "3 4\n4 3\n2 5\n1 3\n3 9\n3 3\n" `shouldBe` "11"
  10. it "solves part 2" $ do
  11. Day1.part2 "3 4\n4 3\n2 5\n1 3\n3 9\n3 3\n" `shouldBe` "31"
  12. describe "Day 2" $ do
  13. it "solves part 1" $ do
  14. Day2.part1 "7 6 4 2 1\n1 2 7 8 9\n9 7 6 2 1\n1 3 2 4 5\n8 6 4 4 1\n1 3 6 7 9" `shouldBe` "2"
  15. it "solves part 2" $ do
  16. Day2.part2 "7 6 4 2 1\n1 2 7 8 9\n9 7 6 2 1\n1 3 2 4 5\n8 6 4 4 1\n1 3 6 7 9" `shouldBe` "4"