-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDay9Spec.hs
41 lines (32 loc) · 995 Bytes
/
Day9Spec.hs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
module Day9Spec where
import Day9
import Test.Hspec
import Test.Hspec.QuickCheck
import Test.QuickCheck
import qualified Data.Text as T
import qualified Data.Text.IO as T
spec :: Spec
spec = describe "Day 5" $ do
it "zipWithNext of a list with size at least 2"
$ zipWithNext [1,2,3,4,5,6,7,8]
`shouldBe` [(1,2), (2,3), (3,4), (4,5), (5,6), (6,7), (7,8)]
it "zipWithNext of a list with size 1"
$ zipWithNext [1]
`shouldBe` []
it "zipWithNext of a empty list"
$ zipWithNext ([] :: [Int])
`shouldBe` []
it "diffWithNext of a list with size at least 2"
$ diffWithNext [1, 3, 6, 10, 15, 21]
`shouldBe` [2, 3, 4, 5, 6]
it "zipWithNext of a list with size 1"
$ zipWithNext [1]
`shouldBe` []
it "zipWithNext of a empty list"
$ zipWithNext ([] :: [Int])
`shouldBe` []
prop ""
$ \l -> reverse (reverse l) == (l :: [Int])
xit "solve the puzzle" $ do
input <- T.readFile "resources/input9"
logic input `shouldBe` Answer