packages feed

hdocs 0.4.1.0 → 0.4.1.1

raw patch · 3 files changed

+14/−7 lines, 3 filesPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

Files

hdocs.cabal view
@@ -1,5 +1,5 @@ name:                hdocs
-version:             0.4.1.0
+version:             0.4.1.1
 synopsis:            Haskell docs tool
 description:
   Tool and library to get docs for installed packages and source files.
@@ -65,6 +65,8 @@   type: exitcode-stdio-1.0
   main-is: Test.hs
   hs-source-dirs: tests
+  other-modules:
+    HelpTest
   build-depends:
     base >= 4.7 && < 5,
     hdocs,
+ tests/HelpTest.hs view
@@ -0,0 +1,5 @@+module HelpTest (test) where
+
+-- | This is test function with documentation
+test :: ()
+test = ()
tests/Test.hs view
@@ -13,15 +13,15 @@ 
 -- | This is main function
 main :: IO ()
-main = runErrorT main' >>= either (\e -> putStrLn e >> exitFailure) (\_ -> exitSuccess) where
+main = runErrorT main' >>= either (\e -> putStrLn e >> exitFailure) (const exitSuccess) where
 	main' :: ErrorT String IO ()
 	main' = do
-		sdocs <- fmt $ liftM snd $ readSource [] "tests/Test.hs"
-		check "Documentation for main"
-			(M.lookup "main" sdocs == Just "This is main function")
+		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 Prelude.null"
+		check "Documentation for installed module: Prelude.null"
 			(M.lookup "null" edocs == Just "Test whether a list is empty.")
 		where
-			check str p = if p then return () else throwError str
+			check str p = unless p $ throwError str
 			fmt = liftM formatDocs