@@ -0,0 +1,83 @@
4+import Data.List (sort)
12+import Test.QuickCheck.Monadic (monadicIO, assert, run)
13+import qualified Streamly.Prelude as S
14+import qualified Streamly.Internal.Data.Stream.IsStream.Top as Top
17+ (maximum, minimum, elem, notElem, null, product, sum, head, last, take)
18+import Test.Hspec as H
19+import Test.Hspec.QuickCheck
27+chooseInt :: (Int, Int) -> Gen Int
30+eq :: Int -> Int -> Bool
36+ forAll (listOf (chooseInt (min_value, max_value))) $ \ls0 ->
37+ forAll (listOf (chooseInt (min_value, max_value))) $ \ls1 ->
38+ monadicIO $ action ls0 ls1
46+ $ Top.joinInner eq (S.fromList ls0) (S.fromList $ sort ls1)
47+ let v2 = [ (i,j) | i <- ls0, j <- ls1, i == j ]
52+joinInnerHash :: Property
54+ forAll (listOf (chooseInt (min_value, max_value))) $ \ls0 ->
55+ forAll (listOf (chooseInt (min_value, max_value))) $ \ls1 ->
56+ monadicIO $ action (map (\a -> (a,a)) ls0) (map (\a -> (a,a)) ls1)
64+ $ Top.joinInnerHash (S.fromList ls0) (S.fromList ls1)
66+ (fst i, fst i, fst j)
73+-------------------------------------------------------------------------------
75+moduleName = "Prelude.Top"
79+ describe moduleName $ do
82+ prop "joinInner" Main.joinInner
83+ prop "joinInnerHash" Main.joinInnerHash