hdocs 0.4.2.0 → 0.4.2.1
raw patch · 2 files changed
+7/−5 lines, 2 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- hdocs.cabal +1/−1
- tests/Test.hs +6/−4
hdocs.cabal view
@@ -1,5 +1,5 @@ name: hdocs -version: 0.4.2.0 +version: 0.4.2.1 synopsis: Haskell docs tool description: Tool and library to get docs for installed packages and source files.
tests/Test.hs view
@@ -3,7 +3,7 @@ ) where import Control.Monad -import Control.Monad.Error +import Control.Monad.Except import qualified Data.Map as M import System.Exit @@ -13,15 +13,17 @@ -- | This is main function main :: IO () -main = runErrorT main' >>= either (\e -> putStrLn e >> exitFailure) (const exitSuccess) where - main' :: ErrorT String IO () +main = runExceptT main' >>= either (\e -> putStrLn e >> exitFailure) (const exitSuccess) where + main' :: ExceptT String IO () main' = do sdocs <- fmt $ liftM snd $ readSource [] "tests/HelpTest.hs" check "Documentation for file: Test.hs, test" (M.lookup "test" sdocs == Just "This is test function with documentation") edocs <- fmt $ moduleDocs [] "Prelude" check "Documentation for installed module: Prelude.null" - (M.lookup "null" edocs == Just "Test whether a list is empty.") + (M.lookup "null" edocs `elem` + [Just "Test whether a list is empty.", + Just "Test whether the structure is empty. The default implementation is\n optimized for structures that are similar to cons-lists, because there\n is no general way to do better."]) where check str p = unless p $ throwError str fmt = liftM formatDocs