aboutsummaryrefslogtreecommitdiff
path: root/haddock-api/test/Haddock/Backends/Hyperlinker/ParserSpec.hs
diff options
context:
space:
mode:
authorŁukasz Hanuszczak <lukasz.hanuszczak@gmail.com>2015-06-28 23:58:24 +0200
committerŁukasz Hanuszczak <lukasz.hanuszczak@gmail.com>2015-06-30 22:37:50 +0200
commit5ddb425bbdc29efdd314ffc18db6c8e6c3609d24 (patch)
tree3008a363c91c809387d58f9ab86fb63b9b8d5cad /haddock-api/test/Haddock/Backends/Hyperlinker/ParserSpec.hs
parent2426a64771339efb4a776799d9bf593d6b8d09a3 (diff)
Add very simple QuickCheck properties for source parser spec.
Diffstat (limited to 'haddock-api/test/Haddock/Backends/Hyperlinker/ParserSpec.hs')
-rw-r--r--haddock-api/test/Haddock/Backends/Hyperlinker/ParserSpec.hs7
1 files changed, 7 insertions, 0 deletions
diff --git a/haddock-api/test/Haddock/Backends/Hyperlinker/ParserSpec.hs b/haddock-api/test/Haddock/Backends/Hyperlinker/ParserSpec.hs
index 5e69b446..38cdbc87 100644
--- a/haddock-api/test/Haddock/Backends/Hyperlinker/ParserSpec.hs
+++ b/haddock-api/test/Haddock/Backends/Hyperlinker/ParserSpec.hs
@@ -2,6 +2,7 @@ module Haddock.Backends.Hyperlinker.ParserSpec (main, spec) where
import Test.Hspec
+import Test.QuickCheck
import Haddock.Backends.Hyperlinker.Parser
@@ -18,6 +19,12 @@ spec = do
parseSpec :: Spec
parseSpec = do
+ it "is total" $
+ property $ \src -> length (parse src) `shouldSatisfy` (>= 0)
+
+ it "retains file layout" $
+ property $ \src -> concatMap tkValue (parse src) == src
+
context "when parsing single-line comments" $ do
it "should ignore content until the end of line" $