diff options
| author | Jan Tuomi <jans.tuomi@gmail.com> | 2022-09-25 23:37:49 +0300 |
|---|---|---|
| committer | Jan Tuomi <jans.tuomi@gmail.com> | 2022-12-05 14:21:53 +0200 |
| commit | 82b9e3f4bf70e911916cf000655cdae2492060df (patch) | |
| tree | ed41dfb8bfb05a1e642995974a58846f5f39cac2 /test/TestUtils.hs | |
| parent | a5ce95f40188c4525bc98307d09015a5dca93bb3 (diff) | |
Add a test to suite
Diffstat (limited to 'test/TestUtils.hs')
| -rw-r--r-- | test/TestUtils.hs | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/test/TestUtils.hs b/test/TestUtils.hs new file mode 100644 index 0000000..478d923 --- /dev/null +++ b/test/TestUtils.hs @@ -0,0 +1,19 @@ +{-# OPTIONS_GHC -Wno-missing-export-lists #-} +module TestUtils where + +import Control.Monad.Except +import Control.Monad.Reader +import Utils + +initialConfig :: Config +initialConfig = Config { + configScriptFileName = Nothing, + configVerboseMode = False, + configShowHelp = False +} + +runLContext :: LContext a -> IO a +runLContext lc = do res <- runExceptT $ runReaderT lc initialConfig + case res of + Left (LException err) -> error err + Right val -> return val |
