Delete duplicate file

This commit is contained in:
Utku Demir 2021-09-04 22:23:12 +12:00
parent ffa1656cae
commit d93c86f404
No known key found for this signature in database
GPG Key ID: F3F8629C3E0BF60B

View File

@ -1,37 +0,0 @@
{-# LANGUAGE TemplateHaskell #-}
module Test.Data.InvertedIndex where
import Data.InvertedIndex
import qualified Data.Map as Map
import qualified Data.Text as Text
import Hedgehog
import qualified Hedgehog.Gen as Gen
import Hedgehog.Main
import qualified Hedgehog.Range as Range
prop_inverted_index :: Property
prop_inverted_index = withDiscards 10000 . withTests 10000 . property $ do
haystack <-
forAll $
Gen.map
(Range.linear 0 100)
( (,)
<$> Gen.text (Range.linear 0 10) Gen.alphaNum
<*> Gen.int (Range.linear 0 100)
)
needle <-
forAll $
(Gen.text (Range.linear 0 5) Gen.alphaNum)
let ii = iiFromList (Map.toList haystack)
annotateShow ii
let expected =
haystack
& Map.filterWithKey
(\t _ -> Text.toLower needle `Text.isInfixOf` Text.toLower t)
actual = iiSearch needle ii
expected === actual