Add another TODO testcase

pull/3/head
Lennart Spitzner 2016-09-03 23:02:49 +02:00
parent b03996e401
commit 9d4192df00
1 changed files with 26 additions and 0 deletions

View File

@ -679,3 +679,29 @@ regressionTests = do
)
=> m ()
|]
it "multiwayif proper indentation" $ do
pendingWith "TODO"
roundTripEqual $
[text|
readMergePersConfig path shouldCreate conf = do
exists <- liftIO $ System.Directory.doesFileExist path
if
| exists -> do
contents <- liftIO $ ByteString.readFile path -- no lazy IO, tyvm.
fileConf <- case Data.Yaml.decodeEither contents of
Left e -> do
liftIO
$ putStrErrLn
$ "error reading in brittany config from " ++ path ++ ":"
liftIO $ putStrErrLn e
mzero
Right x -> return x
return $ fileConf Semigroup.<> conf
| shouldCreate -> do
liftIO $ ByteString.writeFile path
$ Data.Yaml.encode
$ cMap (Option . Just . runIdentity) staticDefaultConfig
return $ conf
| otherwise -> do
return conf
|]