From 5ddb425bbdc29efdd314ffc18db6c8e6c3609d24 Mon Sep 17 00:00:00 2001 From: Ɓukasz Hanuszczak Date: Sun, 28 Jun 2015 23:58:24 +0200 Subject: Add very simple QuickCheck properties for source parser spec. --- haddock-api/test/Haddock/Backends/Hyperlinker/ParserSpec.hs | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'haddock-api/test/Haddock/Backends/Hyperlinker') 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" $ -- cgit v1.2.3