content: {-# LANGUAGE OverloadedStrings #-}
  module Day16Spec (spec) where
  
  import Data.Text (Text)
  import qualified Data.Text as T (unlines)
  import Day16 (day16)
  import Test.Hspec (Spec, describe, it, shouldBe)
  
  example :: Text
  example = T.unlines
    [ "Valve AA has flow rate=0; tunnels lead to valves DD, II, BB"
    , "Valve BB has flow rate=13; tunnels lead to valves CC, AA"
    , "Valve CC has flow rate=2; tunnels lead to valves DD, BB"
    , "Valve DD has flow rate=20; tunnels lead to valves CC, AA, EE"
    , "Valve EE has flow rate=3; tunnels lead to valves FF, DD"
    , "Valve FF has flow rate=0; tunnels lead to valves EE, GG"
    , "Valve GG has flow rate=0; tunnels lead to valves FF, HH"
    , "Valve HH has flow rate=22; tunnel leads to valve GG"
    , "Valve II has flow rate=0; tunnels lead to valves AA, JJ"
    , "Valve JJ has flow rate=21; tunnel leads to valve II"
    ]
  
  spec :: Spec
  spec = do
      describe "part 1" $ do
          it "examples" $ do
              day16 1 30 example `shouldBe` Right 1651
      describe "part 2" $ do
          it "examples" $ do
              day16 2 26 example `shouldBe` Right 1707
  