From 4cb3261069076fd3f1d94c1faaf2f070c84a8a65 Mon Sep 17 00:00:00 2001 From: Rob Rix Date: Wed, 22 Jun 2016 11:07:43 -0400 Subject: [PATCH] Correct the property by limiting it to d > 0. --- test/Data/Gram/Spec.hs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/test/Data/Gram/Spec.hs b/test/Data/Gram/Spec.hs index 1d9d033fa..5df36a6fe 100644 --- a/test/Data/Gram/Spec.hs +++ b/test/Data/Gram/Spec.hs @@ -7,6 +7,7 @@ import Data.String import Prologue import Test.Hspec import Test.Hspec.QuickCheck +import Test.QuickCheck spec :: Spec spec = parallel $ do @@ -14,5 +15,5 @@ spec = parallel $ do it "exists" pending describe "featureVector" $ do - prop "produces a vector of the specified dimension" $ - \ grams d -> length (featureVector (fromList (grams :: [Gram String])) d) `shouldBe` d + prop "produces a vector of the specified dimension" $ forAll (arbitrary `suchThat` ((> 0) . snd)) $ + \ (grams, d) -> length (featureVector (fromList (grams :: [Gram String])) d) `shouldBe` d