Skip to content

Commit

Permalink
Use the debugging env variable for the tests too
Browse files Browse the repository at this point in the history
  • Loading branch information
anka-213 committed Oct 18, 2021
1 parent 2bacba9 commit 0e7dfca
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions mengwong/mp/test/Spec.hs
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,16 @@ import AnyAll
import Types
import qualified Data.ByteString.Lazy as BS
import Control.Monad.Reader (ReaderT(runReaderT))
import System.Environment (lookupEnv)

parseR p = parse (runReaderT p defConfig)
-- TODO: Fetch config from env here too
defConfig = RC False 0

main :: IO ()
main = hspec $ do
main = do
mpd <- lookupEnv "MP_DEBUG"
let runConfig = RC (maybe False (read :: String -> Bool) mpd) 0
let parseR p = parse (runReaderT p runConfig)

hspec $ do
describe "Nothing Test" $ do
it "should be nothing" $ do
(Nothing :: Maybe ()) `shouldBe` (Nothing :: Maybe ())
Expand Down

0 comments on commit 0e7dfca

Please sign in to comment.