diff --git a/hdocs.cabal b/hdocs.cabal
--- a/hdocs.cabal
+++ b/hdocs.cabal
@@ -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,
diff --git a/tests/HelpTest.hs b/tests/HelpTest.hs
new file mode 100644
--- /dev/null
+++ b/tests/HelpTest.hs
@@ -0,0 +1,5 @@
+module HelpTest (test) where
+
+-- | This is test function with documentation
+test :: ()
+test = ()
diff --git a/tests/Test.hs b/tests/Test.hs
--- a/tests/Test.hs
+++ b/tests/Test.hs
@@ -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
