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.

30 lines
833 B

3 weeks ago
3 weeks ago
  1. module Main (main) where
  2. import Test.Hspec
  3. import Day1
  4. import Day2
  5. import Day3
  6. main :: IO ()
  7. main = do
  8. hspec $ do
  9. describe "Day1" $ do
  10. it "solves part 1" $ do
  11. input <- readFile "test/1"
  12. Day1.part1 input `shouldBe` "11"
  13. it "solves part 2" $ do
  14. input <- readFile "test/1"
  15. Day1.part2 input `shouldBe` "31"
  16. describe "Day 2" $ do
  17. it "solves part 1" $ do
  18. input <- readFile "test/2"
  19. Day2.part1 input `shouldBe` "2"
  20. it "solves part 2" $ do
  21. input <- readFile "test/2"
  22. Day2.part2 input `shouldBe` "4"
  23. describe "Day 3" $ do
  24. it "solves part 1" $ do
  25. input <- readFile "test/3.1"
  26. Day3.part1 input `shouldBe` "161"
  27. it "solves part 2" $ do
  28. input <- readFile "test/3.2"
  29. Day3.part2 input `shouldBe` "48"