blob: 142d1308146f5750e9b1d16b08d1ac967138b67e [file] [log] [blame]
Matthias Andreas Benkard262110d2021-08-24 06:35:55 +02001{-# LANGUAGE OverloadedStrings #-}
2
3module Mulkup.ConfigSpec (cases) where
4
5import Mulkup.Config
6import Mulkup.Prelude
7import Test.Tasty
8import Test.Tasty.HUnit
9
10cases :: TestTree
11cases =
12 testGroup
13 "ConfigSpec"
14 [unit_simpleConfig]
15
16unit_simpleConfig :: TestTree
17unit_simpleConfig = testCase "unit_simpleConfig" $ do
18 void $ readConfig exampleConfigText
19 where
20 exampleConfigText =
21 "\
22 \{ host = \"atmon\" \
23 \ \
24 \, stashes = \
25 \ [ { name = \"mulk\" \
26 \ \
27 \ , baseDir = \"/Users/mulk\" \
28 \ \
29 \ , tiers = \
30 \ { hourly = { keep = 48 } \
31 \ , daily = { keep = 4 } \
32 \ , weekly = { keep = 4 } \
33 \ , monthly = { keep = 12 } \
34 \ } \
35 \ \
36 \ , exclusions = \
37 \ [ \
38 \ , \"**/.stack-work\" \
39 \ , \"**/dist-newstyle\" \
40 \ \
41 \ , \"~/.boot/cache\" \
42 \ , \"~/.cabal/bin\" \
43 \ , \"~/.cabal/packages\" \
44 \ , \"~/.cache\" \
45 \ ] \
46 \ } \
47 \ ] \
48 \}"