1
1
mirror of https://github.com/github/semantic.git synced 2024-12-29 18:06:14 +03:00

Correct the property by limiting it to d > 0.

This commit is contained in:
Rob Rix 2016-06-22 11:07:43 -04:00
parent 0bef12d722
commit 4cb3261069

View File

@ -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