@@ -67,18 +67,18 @@ dropPercent :: String -> String
6767dropPercent ('%':xs) = dropWhile (== ' ') xs
6868dropPercent xs = xs
6969
70−runCommandTest :: FilePath -> (Int, String) -> IO TestTree
71−runCommandTest pandocpath (num, code) = do
70+runCommandTest :: FilePath -> (Int, String) -> TestTree
71+runCommandTest pandocpath (num, code) =
7272 let codelines = lines code
73− let (continuations, r1) = span ("\\" `isSuffixOf`) codelines
74− let (cmd, r2) = (dropPercent (unwords (map init continuations ++ take 1 r1)),
73+ (continuations, r1) = span ("\\" `isSuffixOf`) codelines
74+ (cmd, r2) = (dropPercent (unwords (map init continuations ++ take 1 r1)),
7575 drop 1 r1)
76− let (inplines, r3) = break (=="^D") r2
77− let normlines = takeWhile (/=".") (drop 1 r3)
78− let input = unlines inplines
79− let norm = unlines normlines
80− let shcmd = trimr $ takeDirectory pandocpath </> cmd
81− return $ runTest ("#" ++ show num) shcmd input norm
76+ (inplines, r3) = break (=="^D") r2
77+ normlines = takeWhile (/=".") (drop 1 r3)
78+ input = unlines inplines
79+ norm = unlines normlines
80+ shcmd = trimr $ takeDirectory pandocpath </> cmd
81+ in runTest ("#" ++ show num) shcmd input norm
8282
8383extractCommandTest :: FilePath -> TestTree
8484extractCommandTest fp = unsafePerformIO $ do
@@ -87,6 +87,6 @@ extractCommandTest fp = unsafePerformIO $ do
8787 Pandoc _ blocks <- runIOorExplode (readMarkdown
8888 def{ readerExtensions = pandocExtensions } contents)
8989 let codeblocks = map extractCode $ filter isCodeBlock $ blocks
90− cases <- mapM (runCommandTest pandocpath) $ zip [1..] codeblocks
90+ let cases = map (runCommandTest pandocpath) $ zip [1..] codeblocks
9191 return $ testGroup fp cases
9292