Matthias Andreas Benkard | 262110d | 2021-08-24 06:35:55 +0200 | [diff] [blame^] | 1 | {-# LANGUAGE OverloadedStrings #-} |
| 2 | |
| 3 | module Mulkup.ConfigSpec (cases) where |
| 4 | |
| 5 | import Mulkup.Config |
| 6 | import Mulkup.Prelude |
| 7 | import Test.Tasty |
| 8 | import Test.Tasty.HUnit |
| 9 | |
| 10 | cases :: TestTree |
| 11 | cases = |
| 12 | testGroup |
| 13 | "ConfigSpec" |
| 14 | [unit_simpleConfig] |
| 15 | |
| 16 | unit_simpleConfig :: TestTree |
| 17 | unit_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 | \}" |