File: FastSet.hs

package info (click to toggle)
haskell-attoparsec 0.14.4-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 880 kB
  • sloc: haskell: 4,749; ansic: 170; makefile: 22
file content (15 lines) | stat: -rw-r--r-- 511 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
module QC.Text.FastSet where

import Test.Tasty (TestTree)
import Test.Tasty.QuickCheck (testProperty)
import Test.QuickCheck
import qualified Data.Attoparsec.Text.FastSet as FastSet

membershipCorrect :: String -> String -> Property
membershipCorrect members others =
    let fs = FastSet.fromList members
        correct c = (c `FastSet.member` fs) == (c `elem` members)
    in property $ all correct (members ++ others)

tests :: [TestTree]
tests = [ testProperty "membership is correct" membershipCorrect ]