Commit 71f7d821 authored by Gebhart97's avatar Gebhart97
Browse files

QuickFix for Windows Formatting of Examples

parent 612cf1ca
......@@ -40,6 +40,10 @@ directoryFiles dir = do
expandDir :: String -> IO [String]
expandDir dir = doesDirectoryExist dir >>= \is_dir -> if is_dir then directoryFiles dir else return [dir]
replaceBackR :: String -> String
replaceBackR ('\r':xs) = replaceBackR xs
replaceBackR (x:xs) = x : replaceBackR xs
replaceBackR "" = ""
outSuffix :: String
outSuffix = ".out"
......@@ -64,7 +68,7 @@ testFileRefine outfile =
let file = dropSuffix outSuffix outfile
in specify ("refine " <> file) $ do
output <- readFile (file ++ outSuffix)
process file `shouldReturn` output
process file `shouldReturn` replaceBackR(output)
where
-- | FIXME: Run each example twice, once with and once without transformations.
process :: FilePath -> IO String
......@@ -81,7 +85,7 @@ testFileMinimize mini =
let file = dropSuffix minimizeSuffix mini
in specify ("minimize " <> file) $ do
minimized <- readFile (file ++ minimizeSuffix)
process file `shouldReturn` minimized
process file `shouldReturn` replaceBackR(minimized)
where
process :: FilePath -> IO String
process file =
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment